Closed ablok closed 2 years ago
Feedback why this is a good/bad idea would be appreciated.
@Matthew-Mallimo could you check the changes I made?
:tada: This PR is included in version 5.1.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Description
Currently, when a screenshot test fails, the actual (received) image is not stored, other than in a diff image. This PR allows users to set 2 variables:
storeReceivedOnFailure
andcustomReceivedDir
. When a test fails, andstoreReceivedOnFailure
is set to true, the received image will also be stored. You can optionally specify a custom location where to store these images by settingcustomReceivedDir
. Not really sure about the naming. Could also use actual instead of received. The feature is currently an addition, but could also be a toggle between storing the composed diff image or storing seperate images. 🤷♂️Motivation and Context
This fixes #260 . This is useful when running in CI. If a screenshot test fails. you can get a new baseline image directly from the build and commit it as the new baseline if the change is as expected.
How Has This Been Tested?
Added unit tests. Tested it locally.
Types of Changes
Checklist:
What is the Impact to Developers Using Jest-Image-Snapshot?
Impact should be none. Use of this feature is optional.