Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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‎

Lines changed: 5 additions & 0 deletions
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‎

Lines changed: 4 additions & 0 deletions
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‎

Lines changed: 4 additions & 4 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /