-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Examples of requiring React once instead of in every test? #186
Comments
Not really a Jest issue. Check out jasmine docs: http://jasmine.github.io/ You should do this:
|
Even if it's not a Jest issue it looks messy and leads to bugs. Why doesn't e.g Mocha have this issue? |
This also makes the test runs very slow. Since HasteModuleLoader has to traverse the dependency tree for each test. I have a workaround for this but it breaks test "hygiene" by reusing mocks so I am hesitant to post it here. |
Anyone looks into this issue? |
Thank you for reporting this issue and appreciate your patience. We've notified the core team for an update on this issue. We're looking for a response within the next 30 days or the issue may be closed. |
The performance problems were fixed with #599. To answer your question (and sorry I never saw this issue before :) ), jest gives you test isolation. It resets the module registry on every call to |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
This is what I have to do in order to get tests to work:
When I try to do this:
I get error:
TypeError: Cannot read property 'firstChild' of undefined
The text was updated successfully, but these errors were encountered: