Printing and Snapshot Fixes#1752
Merged
Merged
Conversation
boujeepossum
approved these changes
Sep 22, 2016
| expect(stripAnsi(diff('123456789', '234567890'))).toBe(null); | ||
| }); | ||
|
|
||
| test('falls back to not call toJSON if objects look identical', () => { |
Contributor
There was a problem hiding this comment.
probably worth adding a test case where two objects have the same internal structure as well
| '[' + typeof obj + ']' | ||
| ); | ||
| return prettyFormat(object, { | ||
| min: true, |
96a043d to
580f945
Compare
…print without toJSON if objects appear similar.
mthmulders
pushed a commit
to mthmulders/jest
that referenced
this pull request
Oct 10, 2016
…print without toJSON if objects appear similar. (jestjs#1752)
tushardhole
pushed a commit
to tushardhole/jest
that referenced
this pull request
Aug 21, 2017
…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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This diff:
pretty-formatinstead of our ownJSON.stringifyserialization. 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 DisabletoJSONin pretty-format it diff is identical. #1728.Test plan
jest