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
just by running tests as usual you cannot write out a snapshot
you can continually update a snapshot without needing to scope the go test command with the correct env var while developing on a narrow feature that isn't stable yet
hey 👋 thanks a lot for opening this issue. I really like this idea. I created a draft pr to support this. I am thinking that the priority should be CI > snaps.Update > UPDATE_SNAPS . So if running on a CI the snaps won't update and will fail. wdyt ?
🚀 Feature Proposal
It would be great to be able to update snapshots more programmatically:
In this way you could have other test conditions / mechanisms that enforce when a snapshot can and should be updated.
Motivation
Today we use the
flag
package which hooks nicely into the standard test utils:Which can be used like so:
See:
This has the nice quality that:
go test
command with the correct env var while developing on a narrow feature that isn't stable yetExample
Combining the motivation and the feature request:
In which case the flags are the only way to update snapshot files.
The text was updated successfully, but these errors were encountered: