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
Is your feature request related to a problem? Please describe.
The issue is that I have to run --snapshot-update in order to initiate a new assertion in a test. This is mostly an annoyance when testing with PyCharm using the IDE testing tools.
Describe the solution you'd like
I would prefer that there is an option that I can set by default that will not update any existing snapshots, but will add any newly created snapshots.
Describe alternatives you've considered
A flag called create-non-existing-snapshots as an option that can be set. This could then be configured in CLI or an IDE.
Additional context
None
The text was updated successfully, but these errors were encountered:
On top of that, I think it would be a great way to onboard former snapshottest users, as creating non-existing snapshots without passing the --snapshot-update option is the default behavior in snapshottest.
I'm open to this idea as opt-in, perhaps a flag --snapshot-update-new-only or something like that.
I will say this was an intentional design decision when initially creating syrupy. This is personal opinion however I believe snapshottest's approach of auto-creating the snapshots when missing is problematic. Imagine if you've written a number of new test cases and forget to create the relevant snapshots. If you push up your changes to your version control system and your CI system runs the test suite, with auto-create functionality, the tests will pass. This gives a false sense of confidence in the test suite. For all you know, the generated snapshot could be different every CI run.
Syrupy's stance is that a missing snapshot is no different from a non-matching snapshot. Syrupy has no way of knowing that you've just written a new test case and so we expect a snapshot not to exist, vs. a test case has been renamed disconnecting it from the snapshot file, or the dev forgot to commit the snapshot artifacts to git when pushing up their branch for CI to run.
Is your feature request related to a problem? Please describe.
The issue is that I have to run
--snapshot-update
in order to initiate a new assertion in a test. This is mostly an annoyance when testing with PyCharm using the IDE testing tools.Describe the solution you'd like
I would prefer that there is an option that I can set by default that will not update any existing snapshots, but will add any newly created snapshots.
Describe alternatives you've considered
A flag called
create-non-existing-snapshots
as an option that can be set. This could then be configured in CLI or an IDE.Additional context
None
The text was updated successfully, but these errors were encountered: