Closed Ayc0 closed 10 months ago
@code-forger what do you think about this new feature?
FYI, due to bade294, the command npm run test:git-history
seems to be failing:
:tada: This PR is included in version 6.3.0 :tada:
The release is available on:
Your semantic-release bot :package::rocket:
Description
Add a new top level option
runtimeHooksPath
that contains a potential path to a JS file. This file can contain multiple hooks whendiffSnapshot
is called, likeonBeforeWriteToDiscPath
(to be able to inject EXIF data to PNGs without building this feature into this library).The reason why I exposed that via a path to a JS file instead of exposing a function, is because
diffSnapshot
is sometimes called from a worker, and we cannot serialize properly functions.For now there is only
onBeforeWriteToDiscPath
but I made that generic enough to be able to add more features to it in the future.Motivation and Context
Fixes: https://github.com/americanexpress/jest-image-snapshot/issues/332
How Has This Been Tested?
I added unit tests for this feature
Types of Changes
Checklist:
What is the Impact to Developers Using Jest-Image-Snapshot?
It shouldn't impact them at all as long as they don't use this new feature