-
-
Notifications
You must be signed in to change notification settings - Fork 698
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strictEqual / deepStrictEqual behave differently on numbers #1532
Comments
Damn this is weird. I feel like I'll dig into this. cc/ @keithamus as someone that might know if this behaviour is actually correct. |
I guess |
Also |
Then reading the
|
Makes me think this is indeed working as expected but maybe a bit confusing. |
I don't know what you mean by "as expected". The discrepancy was not the result of a typo, but it's also not a reasonable design choice. I think I would expect chai to change |
Chai's behavior of
strictEqual
anddeepStrictEqual
differ in how they treat numbers (particularlyNaN
and-0
). It seems like "depth" should not affect the equality of two shallow objects.Note that the documentation adds confusion, since it says that "deep equality" refers to
deep-eql
semantics and "strict equality" refers to===
:chai/lib/chai/core/assertions.js
Lines 1716 to 1718 in 1a8247f
It appears
deepStrictEqual
was originally added as an alias forstrictEqual
to match Node: #653The text was updated successfully, but these errors were encountered: