jest-screenshot icon indicating copy to clipboard operation
jest-screenshot copied to clipboard

update snapshots issue

Open bboydflo opened this issue 4 years ago • 3 comments

Not really sure that is an issue, but if one of the snapshots fails, I want to update snapshots, but all of them seem to get updated. I actually want to update only the snapshot that failed.

Is that even possible?

PS: Many thanks for this library. It works great!

bboydflo avatar Jan 22 '21 13:01 bboydflo

Not yet :/ How would we determine which snapshots to update and which not? Obviously they all changed with changes below the threshold.

Prior99 avatar Jan 29 '21 11:01 Prior99

Not sure I understand entirely how the tool works but if jest is ran with like this jest --updateSnapshot I was hoping that the library can decide to update the failing snapshot.

bboydflo avatar Jan 29 '21 15:01 bboydflo

That's what it does, however, considering the following:

Let's say you set the threshold to 50% and only 49% of the pixels changed.

Now, when you run jest with -u, the test is not failing, but the image did change.

In that case, jest-screenshot will still update the image, even though it did not fail.

Prior99 avatar Jan 30 '21 08:01 Prior99