americanexpress / jest-image-snapshot

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

failureThresholdType=percent is confusing #323

Open noomorph opened 1 year ago

noomorph commented 1 year ago

According to the code, when you define failureThreshold: 0.01, failureThresholdType: 'percent', that means 1% in fact.

I think this is misleading because percent is 1/100 (per+cent), and it is not a fraction (0..1).

Could you please rename it to fraction and add the real percent unit, i.e. 0.01 percent → 0.0001 and 1 percent → 0.01 accordingly?

Thanks in advance.

joriswitteman commented 1 year ago

Second this. I've lost quite some time misunderstanding what to fill here. Like OP says, failureThresholdType percent is entirely misleading if 0.1 in fact means 10%