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
snapshots in Jest are not automatically written when Jest is run in a CI system without explicitly passing --updateSnapshot. It is expected that all snapshots are part of the code that is run on CI and since new snapshots automatically pass, they should not pass a test run on a CI system. It is recommended to always commit all snapshots and to keep them in version control.
The text was updated successfully, but these errors were encountered:
Error: New snapshot was not written. The update flag must be explicitly passed to write a new snapshot.
+ This is likely because this test is run in a continuous integration (CI) environment in which snapshots are not written by default.
when the CI environment variable is set to true. In fact, there's a specific test that checks for CI behavior. I haven't dug into the code to see how CI support is actually implemented, but this issue is likely already done
Currently, if a snapshot doesn't exist it is automatically added and passes.
https://github.com/americanexpress/jest-image-snapshot/blob/main/src/diff-snapshot.js#L207
To be inline with jest snapshots it should fail when CI=true and new snapshots are added.
https://jestjs.io/docs/snapshot-testing#are-snapshots-written-automatically-on-continuous-integration-ci-systems
The text was updated successfully, but these errors were encountered: