question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Need help for my unit test with load

See original GitHub issue

💬 Questions and Help

I have a wrapped loadableComponent inside another stateless component, I want to check if the loadable it’s already rendered, previously with react-loadable, we didn’t need to worry about this since with the help of preloadAll() we achieved it, but not sure how to force the load of the component before my assertion happen.

const wrapper = mount(<Wrapper name="test" `/>);

expect(wrapper.find('svg')).toHaveLength(1); // not loaded yet
const Wrapper = (props) => {
   const MyLoadable = loadable(() => import('./MyOtherComp');

   return (<Errors><MyLoadable /></Errors>);
}

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
gregbergecommented, Feb 3, 2020

With react-testing-library you should be able to wait for the component to be ready.

1reaction
open-collective-bot[bot]commented, Jan 27, 2020

Hey @yanv1991 👋, Thank you for opening an issue. We’ll get back to you as soon as we can. Please, consider supporting us on Open Collective. We give a special attention to issues opened by backers. If you use Loadable at work, you can also ask your company to sponsor us ❤️.

<link>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Create and run a load test - Visual Studio (Windows)
Learn how to create a load test that contains unit tests. You create and run load tests using Visual Studio Enterprise.
Read more >
Adding unit tests to visual studio 2017 load test - Stack Overflow
You need to have the tests target the correct framework dll manually. VS Load Test will not detect unit tests in newer versions....
Read more >
What is a good method to unit test the load of the Config File in ...
I want to setup a test sequence, invoke the InitAllSettings.xaml and then put some activities in to unit test the load of the...
Read more >
To load or not to load data for unit tests from external files
So long answer short, it depends on what you're testing and why. Both approaches are useful and have their place - choose what...
Read more >
Keys to Successful Unit Testing - Software Testing Help
The process becomes agile: To add new functions or features to the existing software, we need to make changes to the old code....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found