Skip to content

Better Jest diffs for nullary sums #51

@samhh

Description

@samhh

Following #50 sums should be comparable with toEqual, however when an expectation fails the diff is a bit rubbish for nullary sums, stating "serializes to the same string".

I believe this is caused by the value (also) being a function rather than just an object.

We could define a custom matcher to fix this, or even override toEqual. How can we differentiate between a nullary sum and a non-nullary constructor? Do we need to?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions