Skip to content

Commit 90295fe

Browse files
committed
chore: upgrade to jest 24
1 parent 96fdb14 commit 90295fe

File tree

6 files changed

+1015
-597
lines changed

6 files changed

+1015
-597
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"google-closure-compiler": "20190301.0.0",
6161
"gzip-size": "^3.0.0",
6262
"jasmine-check": "^1.0.0-rc.0",
63-
"jest": "^23.1.0",
64-
"jest-diff": "^23.0.1",
63+
"jest": "^24.8.0",
64+
"jest-diff": "^24.8.0",
6565
"minimatch": "^3.0.4",
6666
"minimist": "^1.2.0",
6767
"mkdirp": "^0.5.1",

packages/jest-mock-scheduler/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1",
22+
"jest": "^23.0.1 || ^24.0.0",
2323
"scheduler": "^0.11.0"
2424
},
2525
"files": [

packages/jest-react/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
},
2020
"homepage": "https://reactjs.org/",
2121
"peerDependencies": {
22-
"jest": "^23.0.1",
22+
"jest": "^23.0.1 || ^24.0.0",
2323
"react": "^16.0.0",
2424
"react-test-renderer": "^16.0.0"
2525
},

scripts/jest/config.base.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,13 @@ module.exports = {
1212
'.*': require.resolve('./preprocessor.js'),
1313
},
1414
setupFiles: [require.resolve('./setupEnvironment.js')],
15-
setupTestFrameworkScriptFile: require.resolve('./setupTests.js'),
15+
setupFilesAfterEnv: [require.resolve('./setupTests.js')],
1616
// Only include files directly in __tests__, not in nested folders.
1717
testRegex: '/__tests__/[^/]*(\\.js|\\.coffee|[^d]\\.ts)$',
1818
moduleFileExtensions: ['js', 'json', 'node', 'coffee', 'ts'],
1919
rootDir: process.cwd(),
2020
roots: ['<rootDir>/packages', '<rootDir>/scripts'],
2121
collectCoverageFrom: ['packages/**/*.js'],
2222
timers: 'fake',
23+
testURL: 'about:blank',
2324
};

scripts/jest/preprocessor.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ module.exports = {
5353
if (filePath.match(/\.ts$/) && !filePath.match(/\.d\.ts$/)) {
5454
return tsPreprocessor.compile(src, filePath);
5555
}
56+
if (filePath.match(/\.json$/)) {
57+
return src;
58+
}
5659
if (!filePath.match(/\/third_party\//)) {
5760
// for test files, we also apply the async-await transform, but we want to
5861
// make sure we don't accidentally apply that transform to product code.

0 commit comments

Comments
 (0)