You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
✖ fail/expect
Error [AssertionError]: expected NaN to equal NaN
✖ fail/assert
Error [AssertionError]: expected NaN to equal NaN
The comparison algorithm behaves differently depending on whether NaN values are compared directly or as deep property/member values. This inconsistency creates confusion and diminishes the developer experience.
We suggest to change the behavior of expect(...).to.equal(...) and assert.strictEqual(..., ...) to match their deep counterparts.
The text was updated successfully, but these errors were encountered:
I think our strictEquals should probably assert correctly that NaN === NaN but the equals is working correctly to me.
I'm not 100% sure on the .deep bits. deep-eql uses Object.is for equality so it makes sense that it says that NaN === NaN like the node implementation.
With all this being said this has been working like this for a while so I think this feedback is good for how we change the API for Chai@v6 as it seems like most of these changes warrant a breaking change.
Consider the following example:
The comparison algorithm behaves differently depending on whether NaN values are compared directly or as deep property/member values. This inconsistency creates confusion and diminishes the developer experience.
We suggest to change the behavior of
expect(...).to.equal(...)
andassert.strictEqual(..., ...)
to match their deep counterparts.The text was updated successfully, but these errors were encountered: