Imagine, you run tests in CI and somehow snapshots are not there (e. g. you forgot to add them to commit): perseus will just silently create missing snapshots without any warnings and CI will pass.
I think it should at least skip the test, give some warning or cause failure.
Since warnings and skipped test does not always make pytest exit with non-zero return code, which would cause CI to fail, I suggest to fail test with some exception or pytest.fail().
Such behaviour should be pretty expected, as we did not actually test anything, but rather created a new snapshot.
Taking into account that perseus 1.0 must be compatible with snapshottest, I suggest to add an option that will trigger new behaviour, and in 2.0 make it default
Imagine, you run tests in CI and somehow snapshots are not there (e. g. you forgot to add them to commit):
perseus
will just silently create missing snapshots without any warnings and CI will pass.I think it should at least skip the test, give some warning or cause failure.
Since warnings and skipped test does not always make
pytest
exit with non-zero return code, which would cause CI to fail, I suggest to fail test with some exception orpytest.fail()
.Such behaviour should be pretty expected, as we did not actually test anything, but rather created a new snapshot.
Taking into account that
perseus
1.0 must be compatible withsnapshottest
, I suggest to add an option that will trigger new behaviour, and in 2.0 make it default