Skip to content

feat(breaking): upgrade to Jest 25 #110

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Feb 4, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions __tests__/__snapshots__/snapshotDiff.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ exports[`can colorize diff 1`] = `
 very
 long
 script
 "
"
`;

exports[`can expand diff 1`] = `
"Snapshot Diff:
- First value
+ Second value


some
some
some
Expand All @@ -36,7 +36,7 @@ exports[`can expand diff 1`] = `
very
long
script
"
"
`;

exports[`can use contextLines on diff 1`] = `
Expand Down Expand Up @@ -92,7 +92,7 @@ exports[`can use stablePatchmarks on diff 1`] = `
@very
@long
@script
"
"
`;

exports[`collapses diffs and strips ansi by default 1`] = `
Expand All @@ -110,7 +110,7 @@ exports[`collapses diffs and strips ansi by default 1`] = `
very
long
script
"
"
`;

exports[`detects React components 1`] = `
Expand Down Expand Up @@ -155,7 +155,7 @@ exports[`diffs short strings 1`] = `
- First value
+ Second value


- abcx
+ abcy
"
Expand Down
10 changes: 5 additions & 5 deletions __tests__/__snapshots__/toMatchDiffSnapshot.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ exports[`proxies "colors" option(s) 1`] = `
 very
 long
 script
 "
"
`;

exports[`proxies "contextLines" option(s) 1`] = `
Expand All @@ -32,7 +32,7 @@ exports[`proxies "expand" option(s) 1`] = `
- First value
+ Second value


some
some
some
Expand All @@ -45,7 +45,7 @@ exports[`proxies "expand" option(s) 1`] = `
very
long
script
"
"
`;

exports[`works with custom name: slim 1`] = `
Expand All @@ -63,7 +63,7 @@ exports[`works with custom name: slim 1`] = `
very
long
script
"
"
`;

exports[`works with default options 1`] = `
Expand All @@ -81,5 +81,5 @@ exports[`works with default options 1`] = `
very
long
script
"
"
`;
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@
"jest": ">=16"
},
"dependencies": {
"jest-diff": "^24.0.0",
"jest-snapshot": "^24.0.0",
"pretty-format": "^24.0.0",
"jest-diff": "^25.1.0",
"jest-snapshot": "^25.1.0",
"pretty-format": "^25.1.0",
"strip-ansi": "^6.0.0"
},
"devDependencies": {
Expand Down
4 changes: 2 additions & 2 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

'use strict';

const diff = require('jest-diff');
const diff = require('jest-diff').default;
const snapshot = require('jest-snapshot');
const reactSerializer = require('./react-serializer');

Expand Down Expand Up @@ -84,7 +84,7 @@ function toMatchDiffSnapshot(
) {
const difference = snapshotDiff(valueA, valueB, options);

return snapshot.toMatchSnapshot.call(this, difference, testName);
return snapshot.toMatchSnapshot.call(this, difference, testName || '');
}

function getSnapshotDiffSerializer() {
Expand Down
Loading