forked from jestjs/jest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update pretty-format and use it for diffs; update snapshot printing; …
…print without toJSON if objects appear similar. (jestjs#1752)
- Loading branch information
Showing
21 changed files
with
693 additions
and
458 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
15 changes: 15 additions & 0 deletions
15
packages/jest-diff/src/__tests__/__snapshots__/diff-test.js.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
exports[`test falls back to not call toJSON if objects look identical 1`] = ` | ||
"[2mCompared values serialize to the same structure. | ||
Printing internal object structure without calling \`toJSON\` instead.[22m | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[2m [22m [2mObject {[22m | ||
[32m-[39m [32m \"line\": 1,[39m | ||
[31m+[39m [31m \"line\": 2,[39m | ||
[2m [22m [2m \"toJSON\": [Function toJSON],[22m | ||
[2m [22m [2m}[22m" | ||
`; | ||
exports[`test prints a fallback message if two objects truly look identical 1`] = `"[2mCompared values have no visual difference.[22m"`; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
19 changes: 19 additions & 0 deletions
19
packages/jest-matcher-utils/src/__tests__/__snapshots__/index-test.js.snap
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
exports[`.stringify() toJSON errors when comparing two objects 1`] = ` | ||
"[2mexpect([22m[31mreceived[39m[2m).toEqual([22m[32mexpected[39m[2m)[22m | ||
Expected value to equal: | ||
[32m{\"b\": 1, \"toJSON\": [Function toJSON]}[39m | ||
Received: | ||
[31m{\"a\": 1, \"toJSON\": [Function toJSON]}[39m | ||
Difference: | ||
[32m- Expected[39m | ||
[31m+ Received[39m | ||
[2m [22m [2mObject {[22m | ||
[32m-[39m [32m \"b\": 1,[39m | ||
[31m+[39m [31m \"a\": 1,[39m | ||
[2m [22m [2m \"toJSON\": [Function toJSON],[22m | ||
[2m [22m [2m}[22m" | ||
`; |
This file contains 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
Oops, something went wrong.