unsplash / sum-types

Safe, ergonomic, non-generic sum types in TypeScript.
https://unsplash.github.io/sum-types/
MIT License
42 stars 2 forks source link

Maintain referential equality of constructors #50

Closed samhh closed 1 year ago

samhh commented 1 year ago

This improves interop with Jest (I think via the behaviour of Object.is), fixing #35.

The output from toEqual when the sums don't match is still unhelpful in the nullary case stating "serializes to the same string". This would probably require a custom matcher to resolve; in any case that can be addressed separately.