-
-
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 chokes on unexpected snapshot file when --no-cache and --watch are used together #7636
Comments
Please include a repro so we can download and investigate |
I am running into similar issues when attempting to run watch mode. I apologize in advance that I, unfortunately, cannot provide a repro.
Run npx envinfo --preset jest
The issue seems to sometimes be fixed by manually deleting all snapshots. |
This might have been fixed as part of #7745 (not released, but you can make the essentially the same change locally by doing |
That said, I cannot reproduce following the steps in the OP Maybe this was fixed as part of the refactoring in #6143 (which landed in Jest 24)? Can any of you reproduce using Jest 24? |
I've upgraded and haven't run into the issue again so far. If I do, I will be sure to let you know. Thanks for looking into this for us Simen! |
Awesome! I'll take a chance and close this, then. Happy to reopen if it's still an issue |
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 is trying to "stat" a test file that does not exist, and it doesn't try to catch in case of failure. For example, let's say you have a test file containing tests that take snapshots. If you rename the test file (but not its snapshot file), Jest later assumes that the snapshot file is legitimate and resolves the associated test file based off the snapshot file path, but only if
--no-cache
and--watch
are used together (which is common when debugging tests).Also, I cannot get stack traces to show (for uncaught Jest errors). Is there a CLI flag for that?
To Reproduce
Steps to reproduce the behavior:
jest
like normaljest --no-cache --watch
Expected behavior
No errors.
Link to repl or repo (highly encouraged)
None yet.
Run
npx envinfo --preset jest
Paste the results here:
The text was updated successfully, but these errors were encountered: