Skip to content

maxDiffThreshold doesn't allow 0 #213

Closed
@OriR

Description

@OriR

Describe the bug
maxDiffThreshold is a number that represents the maximum fractional value of pixels changed, where 1 means all pixels are different and 0 means all pixels are the same.

However, when setting it to 0, it fallbacks to 0.01.

To Reproduce
Set maxDiffThreshold to 0, create a test that matches the snapshots and run it, then change a single character and see that the test still passes.

Expected behavior
The above test should fail.

Additional context
It appears to be because the default value is set using || and not using ?? which makes 0 a falsy value and thus fallbacks to 0.01.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions