Skip to content
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

Reporting for undefined diffs in deepEqual is unhelpful #7

Open
dbushong opened this issue Feb 6, 2014 · 3 comments
Open

Reporting for undefined diffs in deepEqual is unhelpful #7

dbushong opened this issue Feb 6, 2014 · 3 comments

Comments

@dbushong
Copy link
Member

dbushong commented Feb 6, 2014

assert.deepEqual { x: 42 }, { x: 42, y: undefined }
Error: deepEqual {"x":42} failed on something that
serializes to the same result (likely some function)

In this case it's a tiny structure and easy to hunt down, but for large structures figuring out which thing has an undefined can be odious.

@EndangeredMassa
Copy link
Contributor

This would require some smarter deepEqual logic.

@johan thoughts?

@johan
Copy link
Contributor

johan commented Feb 6, 2014

I couldn't agree more; patches to improve this situation are warmly welcome and encouraged.

The current output is one step up from stating your two objects did not match, and showing two huge identical JSON serializations, which I think was the behaviour of assertive's predecessor.

The not-yet-exposed stringify (with potential additional needed tweaks) might be one approach, but I assume non-serialization-based logic in deepEqual is the more solid workable approach.

@EndangeredMassa
Copy link
Contributor

Something like deep-diff might be useful for displaying the differences in a concise way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants