I am using jest snapshots, as well as jest-image-snapshots. They work locally, but when I run them in the azure pipeline I get:
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.
Wouldn't updating the snapshots on every run defeat the purpose?
I've researched a bit but the best solutions I came to were updating snapshots, or removing CI=true. Removing CI=true did not work, and I don't see how updating snapshots could be a good solution.
This is happening for both unit tests, as well as image-snapshots within integration tests.
Any clarification or alternative solutions are appreciated.