Skip to content

Commit c7d0c19

Browse files
authored
chore(breaking): bump Jest to 26 (#128)
* chore(breaking): bump Jest to 26 * update travis, fix flow * lint fix
1 parent 5d38d77 commit c7d0c19

File tree

7 files changed

+1181
-1190
lines changed

7 files changed

+1181
-1190
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: node_js
22
node_js:
33
- '12'
4-
- '8'
4+
- '10'
55
before_install:
66
- yarn global add greenkeeper-lockfile@1
77
install: yarn --ignore-engines

__tests__/__snapshots__/snapshotDiff.test.js.snap

+1-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ exports[`diffs short strings 1`] = `
163163

164164
exports[`failed optional deps throws with sensible message on missing react-test-renderer 1`] = `
165165
"Failed to load optional module \\"react-test-renderer\\". If you need to compare React elements, please add \\"react-test-renderer\\" to your project's dependencies.
166-
Cannot find module 'non-existent-module-for-testing' from 'snapshotDiff.test.js'"
166+
Cannot find module 'non-existent-module-for-testing' from '__tests__/snapshotDiff.test.js'"
167167
`;
168168

169169
exports[`shows diff when comparing React fragments of varying length 1`] = `

__tests__/snapshotDiff.test.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,11 @@ const noIndentB = `
7979
`;
8080

8181
type Props = {
82-
test: string,
82+
test?: string,
83+
unnamedFunction?: () => void,
84+
unnamedJestMock?: () => void,
85+
namedJestMock?: () => void,
86+
withSecond?: boolean,
8387
};
8488

8589
class Component extends React.Component<Props> {

babel.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ module.exports = {
22
presets: [
33
'@babel/preset-react',
44
'@babel/preset-flow',
5-
['@babel/preset-env', { targets: { node: 6 } }],
5+
['@babel/preset-env', { targets: { node: '10' } }],
66
],
77
};

package.json

+7-4
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,16 @@
1515
"watch": "babel -w src --out-dir build"
1616
},
1717
"repository": "https://github.com/thymikee/snapshot-diff",
18+
"engines": {
19+
"node": ">=10"
20+
},
1821
"peerDependencies": {
1922
"jest": ">=16"
2023
},
2124
"dependencies": {
22-
"jest-diff": "^25.1.0",
23-
"jest-snapshot": "^25.1.0",
24-
"pretty-format": "^25.1.0"
25+
"jest-diff": "^26.0.1",
26+
"jest-snapshot": "^26.0.1",
27+
"pretty-format": "^26.0.1"
2528
},
2629
"devDependencies": {
2730
"@babel/cli": "^7.7.0",
@@ -35,7 +38,7 @@
3538
"enzyme-to-json": "^3.4.0",
3639
"eslint": "^6.6.0",
3740
"flow-bin": "^0.123.0",
38-
"jest": "^24.0.0",
41+
"jest": "^26.0.1",
3942
"react": "^16.13.1",
4043
"react-dom": "16.13.1",
4144
"react-test-renderer": "^16.13.1"

src/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ function diffStrings(valueA: any, valueB: any, options: Options) {
7676
contextLines: options.contextLines,
7777
aAnnotation: options.aAnnotation,
7878
bAnnotation: options.bAnnotation,
79-
...(!options.colors ? noDiffColors : {})
79+
...(!options.colors ? noDiffColors : {}),
8080
});
8181
}
8282

0 commit comments

Comments
 (0)