Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(screenshot): alert user when toMatchScreenshot uses NaN (#4891)
ensures that `deviceScaleFactor` is properly narrowed to type `number` from `number | undefined`. prior to this commit, the property _could_ be set to `undefined`. this would result in multiplying by `undefined`, producing `NaN` in our calculation of mismatched pixels. this value would be used in a comparison operator, which would always return false. that is, if `deviceScaleFactor` is `undefined`, we would always fail a test using this matcher. that logic doesn't actually change - instead, we throw a much more explicit error instead of silently failing
- Loading branch information