Skip to content

Commit

Permalink
chore: upgrade to jest 24
Browse files Browse the repository at this point in the history
  • Loading branch information
SimenB committed May 30, 2019
1 parent 96fdb14 commit 90295fe
Show file tree
Hide file tree
Showing 6 changed files with 1,015 additions and 597 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@
"google-closure-compiler": "20190301.0.0",
"gzip-size": "^3.0.0",
"jasmine-check": "^1.0.0-rc.0",
"jest": "^23.1.0",
"jest-diff": "^23.0.1",
"jest": "^24.8.0",
"jest-diff": "^24.8.0",
"minimatch": "^3.0.4",
"minimist": "^1.2.0",
"mkdirp": "^0.5.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-mock-scheduler/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"homepage": "https://reactjs.org/",
"peerDependencies": {
"jest": "^23.0.1",
"jest": "^23.0.1 || ^24.0.0",
"scheduler": "^0.11.0"
},
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/jest-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
},
"homepage": "https://reactjs.org/",
"peerDependencies": {
"jest": "^23.0.1",
"jest": "^23.0.1 || ^24.0.0",
"react": "^16.0.0",
"react-test-renderer": "^16.0.0"
},
Expand Down
3 changes: 2 additions & 1 deletion scripts/jest/config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@ module.exports = {
'.*': require.resolve('./preprocessor.js'),
},
setupFiles: [require.resolve('./setupEnvironment.js')],
setupTestFrameworkScriptFile: require.resolve('./setupTests.js'),
setupFilesAfterEnv: [require.resolve('./setupTests.js')],
// Only include files directly in __tests__, not in nested folders.
testRegex: '/__tests__/[^/]*(\\.js|\\.coffee|[^d]\\.ts)$',
moduleFileExtensions: ['js', 'json', 'node', 'coffee', 'ts'],
rootDir: process.cwd(),
roots: ['<rootDir>/packages', '<rootDir>/scripts'],
collectCoverageFrom: ['packages/**/*.js'],
timers: 'fake',
testURL: 'about:blank',
};
3 changes: 3 additions & 0 deletions scripts/jest/preprocessor.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ module.exports = {
if (filePath.match(/\.ts$/) && !filePath.match(/\.d\.ts$/)) {
return tsPreprocessor.compile(src, filePath);
}
if (filePath.match(/\.json$/)) {
return src;
}
if (!filePath.match(/\/third_party\//)) {
// for test files, we also apply the async-await transform, but we want to
// make sure we don't accidentally apply that transform to product code.
Expand Down
Loading

0 comments on commit 90295fe

Please sign in to comment.