Skip to content
/ patina Public

Type-safe nothing-handling and error-handling library for TypeScript

License

Notifications You must be signed in to change notification settings

bkiac/patina

Repository files navigation

Similar libraries

Other useful libraries

Testing

Adding an iterator to the Result class has introduced behavior that affects how testing libraries handle deep comparisons of instances of this class. This is interfering with how deep equality checks are performed, as the tests rely on iterating over object properties or their prototypes to determine equality.

This means asserting equality between any two instances of the Result class will always pass, even if the instances are not equal:

expect(Ok()).toEqual(Ok(1));
expect(Err()).toEqual(Err(1));
expect(Ok()).toEqual(Err());

To properly test equality between instances of the Result class, you can unwrap the value and compare it directly:

expect(Ok().unwrap()).toEqual(Ok(1).unwrap()); // Now fails as expected

About

Type-safe nothing-handling and error-handling library for TypeScript

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published