Prior99 / jest-screenshot

A jest extension to deal with screenshots and all sorts of images.
MIT License
71 stars 21 forks source link

update snapshots issue #47

Open bboydflo opened 3 years ago

bboydflo commented 3 years ago

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!

Prior99 commented 3 years ago

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

bboydflo commented 3 years ago

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.

Prior99 commented 3 years ago

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.