Prior99 / jest-screenshot

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

Enable configuration overrides via matcher #84

Open chrismansfield opened 2 years ago

chrismansfield commented 2 years ago

This adds the possibility to override the settings detectAntialiasing, colorThreshold, pixelThresholdAbsolute and pixelThresholdRelative via parameters to the matcher;

expect(myFlakyImage).toMatchImageSnapshot({
       detectAntialiasing: true,
       colorThreshold: 0.1,
       pixelThresholdAbsolute: 25,
       pixelThresholdRelative: 0.1
});

This fixes #72

Prior99 commented 2 years ago

I am currently very busy, I am sorry that I did not yet have the time to review this :(

tujoworker commented 2 years ago

Thanks for the PR! This looks promising 🙌 very good work @chrismansfield