Skip to content

Commit

Permalink
Update jest-diff to remove colors from no diff message
Browse files Browse the repository at this point in the history
Updates to the latest jest-diff which now supports removing color codes
from "no visual difference" message. A test has been added to confirm
this and prevent regressions in the future. All jest packages in use
have been updated as part of this commit.

Fixes #129
  • Loading branch information
alistairjcbrown committed Jun 25, 2020
1 parent 2c32732 commit f70d915
Show file tree
Hide file tree
Showing 4 changed files with 356 additions and 325 deletions.
5 changes: 5 additions & 0 deletions __tests__/__snapshots__/snapshotDiff.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ exports[`failed optional deps throws with sensible message on missing react-test
Cannot find module 'non-existent-module-for-testing' from '__tests__/snapshotDiff.test.js'"
`;

exports[`no difference 1`] = `
"Snapshot Diff:
Compared values have no visual difference."
`;

exports[`shows diff when comparing React fragments of varying length 1`] = `
"Snapshot Diff:
- <FragmentComponent />
Expand Down
4 changes: 4 additions & 0 deletions __tests__/snapshotDiff.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,3 +267,7 @@ describe('failed optional deps', () => {
).toThrowErrorMatchingSnapshot();
});
});

test('no difference', () => {
expect(snapshotDiff('a', 'a')).toMatchSnapshot();
});
8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
"jest": ">=16"
},
"dependencies": {
"jest-diff": "^26.0.1",
"jest-snapshot": "^26.0.1",
"pretty-format": "^26.0.1"
"jest-diff": "^26.1.0",
"jest-snapshot": "^26.1.0",
"pretty-format": "^26.1.0"
},
"devDependencies": {
"@babel/cli": "^7.7.0",
Expand All @@ -38,7 +38,7 @@
"enzyme-to-json": "^3.4.0",
"eslint": "^7.0.0",
"flow-bin": "^0.127.0",
"jest": "^26.0.1",
"jest": "^26.1.0",
"react": "^16.13.1",
"react-dom": "16.13.1",
"react-test-renderer": "^16.13.1"
Expand Down
Loading

0 comments on commit f70d915

Please sign in to comment.