FormidableLabs / react-native-owl

Visual regression testing library for React Native that enables developers to introduce visual regression tests to their apps.
https://formidable.com/open-source/react-native-owl/
MIT License
639 stars 28 forks source link

[Feature Request]Add tolerance threshold settings for screenshots #141

Closed muhammadkhan0009 closed 1 year ago

muhammadkhan0009 commented 1 year ago

Description

Fixes # (issue)

Type of Change

How Has This Been Tested?

The changes have been tested via doing monkey patch on our app repo and verified that tests are passing now after this change. As I added an optional prop named threshold, therefore custom jest matcher toMatchBaseline function would be called as follow:

 const result = toMatchBaseline(latestPath, { threshold: 0.2 });

Checklist: (Feel free to delete this section upon completion)

Screenshots (for visual changes):

robwalkerco commented 1 year ago

@muhammadkhan0009 Thanks so much for your PR. I've opened #142 which takes your changes, plus adds a default value, updates the types and updates the docs.

muhammadkhan0009 commented 1 year ago

@robwalkerco Thank you for adding the PR.