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
I think it would be better if the message of assert.deepEqual was not limited to a depth of 3, and could display the first difference between the objects, like some testing libraries do
Activity
caub commentedon Sep 30, 2017
I think there needs a different shape of AssertionError for deepEqual, maybe replacing original and expected by a string showing either:
in both case, it could be worth to represent (possibly deep) object paths maybe like:
or
What are the thoughts? I'll be glad to try to implement it
joyeecheung commentedon Oct 1, 2017
Not really object to this idea, but there is already power-assert that basically does the same thing (with very fancy diffs)
caub commentedon Oct 18, 2017
I checked power-assert, it's fancy, but I think a simple approach can be worth for this specific case of object compaisons (not expressions, ...)
https://repl.it/Mqyy/4
caub commentedon Nov 18, 2017
I made this: https://github.com/caub/deep-eq.
Power-assert is cool indeed, but requires transpiling, etc..
I'd still like possibly to change node's assert deepEqual, because it's there by default, and it's really not practical
BridgeAR commentedon Jan 24, 2018
This got fixed by two PRs: #17615 (strict mode) and #17907 (non strict mode). The object might still be cut off though due to being very big.
BridgeAR commentedon Jan 24, 2018
Note: Node.js
assert(value)got also improved (#17581) and is somewhat similar to the power-assert one, even though not as sophisticated.