americanexpress / jest-image-snapshot

✨ Jest matcher for image comparisons. Most commonly used for visual regression testing.
Apache License 2.0
3.84k stars 200 forks source link

require failureThreshold at both percentage and pixel level ? #351

Open taozhou-glean opened 8 months ago

taozhou-glean commented 8 months ago

we have some large screenshots, the percentage itself (0.001) there can still be large enough to not capture certain changes we want, so would be nice to have a 0.001 with percent and min-pixel like 300 at the same time

taozhou-glean commented 8 months ago

here is the proposed interface:

// number for backward compatible
failureThreshold: number | {
  pixel: number,
  percent: number,
}
// or leave `both` out to infer based on above object type
failureThresholdType: "pixel" | "percent" | "both"