-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Printing and Snapshot Fixes #1752
Conversation
@@ -68,6 +68,12 @@ test('oneline strings', () => { | |||
expect(stripAnsi(diff('123456789', '234567890'))).toBe(null); | |||
}); | |||
|
|||
test('falls back to not call toJSON if objects look identical', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably worth adding a test case where two objects have the same internal structure as well
'[' + typeof obj + ']' | ||
); | ||
return prettyFormat(object, { | ||
min: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<3
96a043d
to
580f945
Compare
…print without toJSON if objects appear similar.
…print without toJSON if objects appear similar. (jestjs#1752)
…print without toJSON if objects appear similar. (jestjs#1752)
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
This diff:
pretty-format
instead of our ownJSON.stringify
serialization. Fixes Printing Issues #1640 and Use pretty-format instead of jest's stringify #1727.toJSON
, we now try to create a second diff that doesn't calltoJSON
. The worst case here is that we'll do twice as much work trying to come up with a diff for the user but it seems like an exceptionally rare case that two objects would look identical in both passes and the best case is that the second diff will actually provide signal to the user. Fixes DisabletoJSON
in pretty-format it diff is identical. #1728.Test plan
jest