-
-
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
Spurious 'require.cache' modification is not permitted
warnings since 25.5.0
#9916
Comments
There's zero change in behavior - messing with However, I can understand it's annoying (I had to mock out |
I'm all for warning as it does serve a purpose, but would postpone that to a (future) major release and "silence" them for now. |
As mentioned in #9841, I'm currently leaning towards removing the warning for Jest 25. Then in Jest 26 I'd like to introduce an API for clearing a single module from the cache (rather than all modules). We could then make deletions in Thoughts? (FWIW, what |
Checking fixes for jestjs/jest#9916
So how do we get rid of this warning and/or how to fix it? I can't figure out a way to bypass the warning and I have over 2000 tests and I see this warning 2000 times (with 3-4 lines for the stack trace), my tests become unreadable. I also tried to revert to the previous version but somehow that doesn't seem to work. My project is Aurelia-Slickgrid if that helps. |
It gives these warnings in |
Released in 25.5.4 |
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. |
💥 Regression Report
Since upgrading to version
25.5.0
I keep getting this warning logged for each test:'require.cache' modification is not permitted
.I assume this is due to #9841, but as this is a change in existing behaviour (and thus a breaking change) I would have not expected this in a minor release, but in a major release.
Last working version
Worked up to version: 25.4.0
Stopped working in version: 25.5.0
Expected behavior
I would have expected this to work as before, without logging warnings.
Run
npx envinfo --preset jest
System:
OS: macOS 10.15.4
CPU: (8) x64 Intel(R) Core(TM) i7-4870HQ CPU @ 2.50GHz
Binaries:
Node: 12.14.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.4 - /usr/local/bin/npm
npmPackages:
jest: ^25.5.0 => 25.5.0
The text was updated successfully, but these errors were encountered: