-
-
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
jest.resetModules
breaks after upgrading from v24
#11426
Comments
Yes, I am experiencing the same issue. Could this please be addressed . From my investigation it seem like the introduction of a file caching about 7 months ago is the main issue. I'm not sure of all the linked caches associated with it, but it seem like As simple acid test for this is clearing out
As it is now, I'm force to create sub-directories in which to output the generated files, which is turn creates inconsistencies between with actual code, and the test code. Please could address this. |
@AriPerkkio I ended up just patching jest to have a config endpoint that accepts a list of reg patterns (similar p.s I did not extensively look into this, and there could be better solutions for dealing with this. My main aim was just to get my tests to pass, with as little changes as possible so I can continue with the project I am working on. All this to say, use at your own risk. |
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
It's not a direct replacement, however this may cover all the needs. If needed, we can work on the merge strategy. Jest has a file system cache that is not cleared, not even using `jest.resetModules()`. As a workaround, we create the webpack config files with a unique suffix. Ref: jestjs/jest#11426 (comment)
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
jest.resetModules
does not reset dynamically generated files. It works perfectly withjest@24
but breaks after >=25.With
jest@24
:With
jest@25
,jest@26
andjest@next
:To Reproduce
Steps to reproduce the behavior:
Commenting out
jest.resetModules
withjest@24
makes the test fail -> works exactly as expected.Expected behavior
The cached
dynamically-generated-file.js
should be purged exactly as it is injest@24
.Link to repl or repo (highly encouraged)
https://github.com/AriPerkkio/jest-resetModules-repro
Use
yarn add --dev jest@25
oryarn add --dev jest@26
to make the test fail.envinfo
Run while
jest@24
is installed:Actual project where I'm running into this issue: https://github.com/AriPerkkio/eslint-remote-tester-run-action/blob/master/src/run-tester.ts
If there is a workaround available please let me know.
The text was updated successfully, but these errors were encountered: