Skip to content

Commit 39f392c

Browse files
Update jest-diff to remove colors from no diff message (#173)
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
1 parent 2c32732 commit 39f392c

File tree

4 files changed

+356
-325
lines changed

4 files changed

+356
-325
lines changed

__tests__/__snapshots__/snapshotDiff.test.js.snap

+5
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,11 @@ exports[`failed optional deps throws with sensible message on missing react-test
166166
Cannot find module 'non-existent-module-for-testing' from '__tests__/snapshotDiff.test.js'"
167167
`;
168168

169+
exports[`no difference 1`] = `
170+
"Snapshot Diff:
171+
Compared values have no visual difference."
172+
`;
173+
169174
exports[`shows diff when comparing React fragments of varying length 1`] = `
170175
"Snapshot Diff:
171176
- <FragmentComponent />

__tests__/snapshotDiff.test.js

+4
Original file line numberDiff line numberDiff line change
@@ -267,3 +267,7 @@ describe('failed optional deps', () => {
267267
).toThrowErrorMatchingSnapshot();
268268
});
269269
});
270+
271+
test('no difference', () => {
272+
expect(snapshotDiff('a', 'a')).toMatchSnapshot();
273+
});

package.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
"jest": ">=16"
2323
},
2424
"dependencies": {
25-
"jest-diff": "^26.0.1",
26-
"jest-snapshot": "^26.0.1",
27-
"pretty-format": "^26.0.1"
25+
"jest-diff": "^26.1.0",
26+
"jest-snapshot": "^26.1.0",
27+
"pretty-format": "^26.1.0"
2828
},
2929
"devDependencies": {
3030
"@babel/cli": "^7.7.0",
@@ -38,7 +38,7 @@
3838
"enzyme-to-json": "^3.4.0",
3939
"eslint": "^7.0.0",
4040
"flow-bin": "^0.127.0",
41-
"jest": "^26.0.1",
41+
"jest": "^26.1.0",
4242
"react": "^16.13.1",
4343
"react-dom": "16.13.1",
4444
"react-test-renderer": "^16.13.1"

0 commit comments

Comments
 (0)