cypress-image-snapshot
cypress-image-snapshot copied to clipboard
Fail test with no snapshot file
Is there any option to fail the test if there is NO snapshot?
Interesting, not currently. Are you envisioning that at the end of your tests, if any snapshot files exist that were not compared on the run the test would fail?
Yeah it would be really useful to have a flag (to use on CI) where if images are missing the tests fail but working locally (without a flag) it would create missing images
Cool, that makes sense. I think we might want to hook into Cypress' test:after:run event to perform these checks.
Any update on this?
I'm interested in this as well. I run Cypress in a CI environment, and I'd like to see a failure on my PRs when new snapshots are created. Two reasons:
- I'd like to be notified that I need to check the new snapshot to make sure it looks as expected.
- A new snapshot could indicate a regression (e.g. an unexpected change in the name of the snapshot, a test that runs when it should have been skipped, etc.)
Yes, this would be a very useful option ... and I think it should be default behavior: If you don't find the file to match fail the test. Then you can use the updateSnapshots=true option and update the screenshots locally.
@jaredpalmer Is there some option to add a quick fix for this?
@lexanth would you be willing to create a PR with your solution from df2f147? That would be very helpful for all people using this package in CI :)
Hey Friends, It seems that this feature is not yet implemented in this library. Is there any fork that has this feature?
The library is ded.