-
-
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
browser field is not respected in concurrent mode w/ multi-project config #6887
Comments
- clearing require.cache causes `Module did not self-register` error from binary dependencies - original issue was isolated in jestjs/jest#6887 - workaround: `fusion test --env node && fusion test --env jsdom` - downsides: coverage for node and jsdom tests are not consolidated Next steps: - tell people to use the workaround - wait for upstream fix in Jest
* Reverts require.cache busting - clearing require.cache causes `Module did not self-register` error from binary dependencies - original issue was isolated in jestjs/jest#6887 - workaround: `fusion test --env node && fusion test --env jsdom` - downsides: coverage for node and jsdom tests are not consolidated Next steps: - tell people to use the workaround - wait for upstream fix in Jest * stop flow nag
@lhorie Thanks for opening the issue! TL;DR I've confirmed the bug and i'll try to explain why it happens:
SummaryA quick fix would be to create a different A proposed solution would be to compute the name used for the resolver from the whole config, or something which is unique enough to not be similar between different projects. |
Wow, thanks for the great write-up and investigation into this bug!
I think this would be great if you could compute the name from the entire config. +1 from me. |
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. |
🐛 Bug Report
Jest does not honor
browser
fields field in concurrent tests correctly if nested inprojects
field.This makes it very difficult to run node and jsdom tests concurrently.
To Reproduce
git clone https://github.com/lhorie/jest-bug yarn yarn test
Expected behavior
This repo configures jest with two projects (one has
browser: true
and tests*.browser.js
files and the other hasbrowser:false
and tests*.node.js
files.There are 22 tests (because more than 20 tests are required to trigger concurrent mode).
11 tests (named a.browser.js through k.browser.js) run in the browser project and look like this:
11 tests (named a.node.js through k.node.js) run in node project and look like this:
All tests should pass. Half of them fail. See repo for output.
Link to repl or repo (highly encouraged)
https://github.com/lhorie/jest-bug
Run
npx envinfo --preset jest
Paste the results here:
Other relevant information
require('clear-module').all()
in a transformer as a workaround to clear require cache breaks if you have binary modules such as farmhash.--runInBand
also does not exhibit the bug but doing so can increase CI time significantlyThe text was updated successfully, but these errors were encountered: