You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: "Outdated snapshot: No snapshot header found." error on Windows with Jest v30.1.0 #15799
FAIL tests/main.test.ts
● Test suite failed to run
Outdated snapshot: No snapshot header found. Jest 19 introduced versioned snapshots to ensure all developers on a project are using the same version of Jest. Please update all snapshots during this upgrade of Jest.
Warning: Before you upgrade snapshots, we recommend that you revert any local changes to tests or other code, to ensure that you do not store invalid state.
at validateSnapshotHeader (node_modules/@jest/snapshot-utils/build/index.js:91:12)
at getSnapshotData (node_modules/@jest/snapshot-utils/build/index.js:156:28)
It's very strange, those snapshot tests works on my windows machine. In our project, our snapshot tests works on our windows developer machines but not in our dockerized CI environment, also using jest 30.1.0.
@Mlocik97 other folks are affected in their Windows-based CI except you. Might I know if 30.1.1 managed to fix your issue? If not, I can open another one for resolution
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Activity
fredrikcarlbom commentedon Aug 27, 2025
It's very strange, those snapshot tests works on my windows machine. In our project, our snapshot tests works on our windows developer machines but not in our dockerized CI environment, also using jest 30.1.0.
fredrikcarlbom commentedon Aug 27, 2025
I expect it to be related to line endings and the
auto.crlfsetting combined with this regex:const SNAPSHOT_HEADER_REGEXP = /^// Jest Snapshot v(.+), (.+)\n/;. Matching
\ninstead of$is likely the problem...Mlocik97 commentedon Aug 27, 2025
Hit exact same issue on Linux in CI. Now all PR pipelines are failing in our company.
martincostello commentedon Aug 27, 2025
Looking to do a PR to fix it now.
martincostello commentedon Aug 27, 2025
#15800
cpojer commentedon Aug 27, 2025
Shipped 30.1.1 with the fix.
hainenber commentedon Aug 27, 2025
Hi, im the PR's author there. Apologies for causing mayhem in the CI realm! 🙇
Lesson learnt: Always test with Windows 🪟
hainenber commentedon Aug 27, 2025
@Mlocik97 other folks are affected in their Windows-based CI except you. Might I know if
30.1.1managed to fix your issue? If not, I can open another one for resolutionMlocik97 commentedon Aug 28, 2025
@hainenber yes, we can still reproduce with 30.1.1 in Github pipeline with configuration:
cpojer commentedon Aug 29, 2025
@hainenber could you investigate and send a PR with a fix?
cpojer commentedon Sep 1, 2025
Released 30.1.2 which should hopefully resolve this issue. Thanks @hainenber.
Mlocik97 commentedon Sep 1, 2025
Thank you, I confirm the issue is resolved now.
github-actions commentedon Oct 2, 2025
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.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.