Test workflow is failing with Jest snapshot errors
See original GitHub issueTest workflow is failing with Jest snapshot errors saying they are not up-to-date - but the updated snapshots have been checked in and the tests pass locally after a clean build.
Github CI run
$ jest --coverage --ci
...
Snapshot Summary
› 11 snapshots failed from 4 test suites. Inspect your code changes or run `yarn test -u` to update them.
Test Suites: 4 failed, 3 passed, 7 total
Tests: 11 failed, 27 passed, 38 total
Snapshots: 11 failed, 7 passed, 18 total
Time: 5.62 s
Local run of the same branch with no other changes
$ jest --coverage --ci
...
Test Suites: 7 passed, 7 total
Tests: 38 passed, 38 total
Snapshots: 18 passed, 18 total
Time: 5.852 s
- checked out the branch to a diff clean location in my machine and tried out the CI commands - no issues 😕
- tried running the build locally in ubuntu container - runs fine without any issues
- switching to mac-os from ubuntu for the workflow doesn’t fix the issue 😦
- Resolved this issue by switching to CircleCi. Tests all pass now.
Reporting here because I like Github actions and would like to continue using it.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:16
- Comments:15 (3 by maintainers)
Top Results From Across the Web
React Snapshot Testing: The Bad Parts | by Nick Gard - Medium
Jest's snapshot testing has been hailed as a quick and easy way to fully test React ... If the tests fail when there...
Read more >Jest-image-snapshot OS Rendering Issue - INTEGU
To solve this issue, we have two options. Either we start implementing a fixed failure threshold as part of the jest-image-snapshot configuration. This...
Read more >Continuous integration for React applications using Jest and ...
Begin by writing tests for the App component. A good starting point is adding a snapshot test to ensure that the component renders...
Read more >Snapshot tests
Snapshot tests. The goal of a unit test is to record the expected output of a function using code. This is a powerful...
Read more >Snapshot Testing with Jest - Buddy.Works
This can be done easily in the interactive test-runner console by entering u , prompting Jest to update the snapshot reference and then...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m having a similar issue with typescript, same node version, npm, and typescript on my local machine than the ci machine, when i run the ci, i’m seeing errors that on my local machine doesn’t appear.
Hello guys, Due to the fact that everything seems to be working now, I will close this issue. If you still experience any issues, feel free to leave a comment here or to create a new issue.