0.1.1 • Published 1 year ago

@patina/std v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

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
0.1.1

1 year ago

0.1.0

1 year ago