-
-
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
globalSetup doesn't process styleMocks / moduleNameMappers #6179
Comments
Any updates on this issue? |
This seems like a feature request, can you post a full example of the bug? |
This comment has been minimized.
This comment has been minimized.
Here is a runnable reproduction of the bug: https://codesandbox.io/s/boring-wilbur-ibkmj Reproduction steps1 - Un-comment
2 - Run the following in the terminal:
Error output:
|
Hi everyone! friendly ping
I have to disagree. I don't think this is a feature request but rather a bug: Reproduction on latest jest versionI prepared a simple reproduction on the latest jest version This is currently preventing us from speeding up our test setup substantially, because we cannot re-use a service for all tests and instead have to re-create it for every test file by putting it in a Thank you :) |
Thanks for the repro cases, I agree this is a bug now (or a feature request to change the behavior, however you want to look at it). If anyone wants to submit a PR to fix it I'm happy to review! |
@rickhanlonii I'm happy to take a look at it. Do you have any recommendations into where I might start looking as a first-time contributor? Thanks! |
@stnwk I do not - I would grep for |
I had to do my own monkey patching of
|
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 30 days. |
This issue was closed because it has been stalled for 30 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. |
🐛 Bug Report
globalSetup does not work with moduleNameMappers. In most setups this would be ok, but there are situations such as SSR where you want to setup a server once, you can run into issues with this.
Related to: #5164
To Reproduce
Expected behavior
globalSetup processes moduleNameMappers. The idea that globalSetup runs before "everything" is not practical. Setup will generally require some configuration options for things to work.
Run
npx envinfo --preset jest
Paste the results here:
The workaround I currently use for both this issue and the related babel-transpile issue:
The text was updated successfully, but these errors were encountered: