jest-image-snapshot: The value passed into the failureThreshold option is compared against a ratio, not a percent, which is confusing since the failureThresholdType is percent.

See this conditional block where the comparison is done. It is really comparing the ratio, not the percent, against the threshold option. That is confusing since the options documentation says to specify percent for the type.

There are two options to fix this: change the comparison to actually be a percentage or change the documentation to specify ratio as the type. The former seems more straightforward, while the latter could be backwards compatible (continue to accept percent but change the documentation to say ratio and check for either when deciding which comparison to do).

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 6
  • Comments: 18 (11 by maintainers)

Most upvoted comments

Yes that’s right @theblang

totally agree, and ambiguity on what something like '0.5' means (50%? 0.5%?) is a bad experience 👍

thoughts on

I wonder if looking for [a] trailing % would be a way…to differentiate the two forms

from issuecomment-415063294?