jaredpalmer / cypress-image-snapshot

Catch visual regressions in Cypress
MIT License
893 stars 158 forks source link

failureThreshold configuration question #228

Open pedrovgs opened 3 years ago

pedrovgs commented 3 years ago

Hi! First of all, thanks for such a great project 👏 I have a question. I'm using the library and I'm wondering what's the range of failureThreshold you can pass as a parameter when adding the cypress command

addMatchImageSnapshotCommand({
    failureThreshold: 0.0,
    failureThresholdType: "percent",
    customDiffConfig: { threshold: 0.0 },
    capture: "viewport",
});

Is it between 1 and 0 meaning 1 is 100% of failure threshold, 0.5 is 50% and 0 is 0% or maybe the range is between 100 and 0 meaning that 100 is 100%, 50 is 50% and 0 is 0%?

Keysox commented 3 years ago

.01 is 1% per https://github.com/americanexpress/jest-image-snapshot#%EF%B8%8F-api