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

Disable toJSON in pretty-format it diff is identical. #1728

Closed
cpojer opened this issue Sep 17, 2016 · 3 comments · Fixed by #1752
Closed

Disable toJSON in pretty-format it diff is identical. #1728

cpojer opened this issue Sep 17, 2016 · 3 comments · Fixed by #1752
Assignees
Milestone

Comments

@cpojer
Copy link
Member

cpojer commented Sep 17, 2016

When comparing two values using toEqual, quite often they can look equal and produce the No visible difference message even though they are completely different objects.

Example:

expect({a: 1, toJSON: () => 'foo'}).toEqual({a: 2, toJSON: () => 'foo'});

this will produce "No visible difference". When this happens, we should run pretty-format again with toJSON calls disabled and then print an initial message that says we are printing the internal object structure (or something) and then diff that.

See #1727

@cpojer cpojer added this to the 15.2.0 milestone Sep 17, 2016
@cpojer cpojer self-assigned this Sep 17, 2016
@cpojer
Copy link
Member Author

cpojer commented Sep 21, 2016

Fixed in 16.

@cpojer cpojer closed this as completed Sep 21, 2016
@aaronabramov
Copy link
Contributor

oh.. thats a sick fix. much simpler that wha i thought it would be :)

This was referenced Nov 17, 2020
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants