-
-
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
Unable to test a project using pirates #6034
Comments
Yeah, we don't really support require hooks at all, as we implement
That probably won't happen, but it might be possible to play a bit nicer with modules like it, or at least detect it and throw a useful error. |
This is pretty much the response I expected. I figured I’d file this as a vote in favor of a more standard config. I really like Jest’s workflow, but things like this worry me. Perhaps a mode that uses the native |
It would break out of the sandbox as well, but that might be an acceptable trade-off for you |
Is there any way to add transforms from test runtime, without changing the config? |
No, transforms runs outside of the test sandbox, and are setup before the sandbox is even created (shared between tests). Jest itself uses |
This issue is stale because it has been open for 1 year with no activity. Remove stale label or comment or this will be closed in 14 days. |
This issue was closed because it has been stalled for 7 days with no activity. Please open a new issue if the issue is still relevant, linking to this one. |
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. |
Do you want to request a feature or report a bug?
Bug
What is the current behavior?
When running jest on a project that uses pirates to customize the loading of modules, jest interferes with the operation of pirates, seeming to prevent it from working correctly. For example, when trying to load code written using ES modules using babel to transpile them, it works just fine when running the tests with mocha.
If the current behavior is a bug, please provide the steps to reproduce and
either a repl.it demo through https://repl.it/languages/jest or a minimal
repository on GitHub that we can
yarn install
andyarn test
.This isn't a minimal example, but cloning https://github.com/square/babel-codemod and checking out the
jest
branch, runningyarn install
andyarn test
will illustrate the problem.What is the expected behavior?
Jest should not interfere with other systems–like pirates–that hook into module loading.
Please provide your exact Jest configuration
Run
npx envinfo --preset jest
in your project directory and paste theresults here
The text was updated successfully, but these errors were encountered: