question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test workflow is failing with Jest snapshot errors

See original GitHub issue

Test 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:closed
  • Created 3 years ago
  • Reactions:16
  • Comments:15 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
semoalcommented, Aug 25, 2020

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.

1reaction
marko-zivic-93commented, May 25, 2022

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found