Prior99 / jest-screenshot

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

[Question]: pixelThreshold value #7

Closed dahfazz closed 6 years ago

dahfazz commented 6 years ago

Hi @Prior99

I implemented screenshot tests and I'm wondering if you could suggest a value for pixelThresholdRelative

I set it at 10% but it was totally random choice. Tkx

Prior99 commented 6 years ago

Hi,

ideally it would be at 0%. However, due to antialiasing and such, this will cause tests to fail often. Honestly, you will have to fiddle with it.

I found values around 1% or 2% to work well. 10% is likely too much and will cause many false positives.

I can also recommend to execute the tests in docker for more stable results across different platforms.

Let me know if that helped you.

dahfazz commented 6 years ago

Thanks a lot I reduced to 1% and I'm OK with the results now