Feature request: only update encountered snapshots #214
Replies: 3 comments
-
You can see I'm using Pest; my assumption is that this should still go here, as the pest library is just a wrapper around this? But lmk if I'm wrong. |
Beta Was this translation helpful? Give feedback.
-
Dear contributor, because this issue seems to be inactive for quite some time now, I've automatically closed it. If you feel this issue deserves some attention from my human colleagues feel free to reopen it. |
Beta Was this translation helpful? Give feedback.
-
@spatie-bot I don't have permission to reopen it but I wouldn't qualify "no response" as "inactive" |
Beta Was this translation helpful? Give feedback.
-
Thanks for this library! It's very useful.
With jest/vitest, doing
vitest run -u MyComponent
updates snapshots for that component and leaves all other snapshots alone. With this libraryvendor/bin/pest tests/Browser/LoginTest.php --update-snapshots
updates my Login snapshots and deletes all other snapshots.It seems like the behavior when
--update-snapshots
is included is to simply delete all snapshots before running tests, and then treat any encountered->toMatchSnapshot()
calls as a new assertion, for which a new snapshot should be made.I don't know if I'm missing something, but I would love it if, instead of deleting all and then running as usual, the library simply made note of the flag at test run, and then did the delete/create as assertions were encountered.
Beta Was this translation helpful? Give feedback.
All reactions