Skip to content

Commit 7e9cb18

Browse files
authored
Upgrade Jest to 17.0 (#1078)
* Replace `scriptPreprocessor` config with `transform`. * Also remove `moduleFileExtensions` which has been redundant since 16.0 (`['js', 'json', 'jsx', 'node’]` is the default)
1 parent 2da6eda commit 7e9cb18

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

Diff for: packages/react-scripts/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
"autoprefixer": "6.5.1",
2727
"babel-core": "6.17.0",
2828
"babel-eslint": "7.0.0",
29-
"babel-jest": "16.0.0",
29+
"babel-jest": "17.0.2",
3030
"babel-loader": "6.2.7",
3131
"babel-preset-react-app": "^1.0.0",
3232
"case-sensitive-paths-webpack-plugin": "1.1.4",
@@ -50,7 +50,7 @@
5050
"gzip-size": "3.0.0",
5151
"html-webpack-plugin": "2.24.0",
5252
"http-proxy-middleware": "0.17.2",
53-
"jest": "16.0.2",
53+
"jest": "17.0.2",
5454
"json-loader": "0.5.4",
5555
"object-assign": "4.1.0",
5656
"path-exists": "2.1.0",

Diff for: packages/react-scripts/utils/createJestConfig.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ module.exports = (resolve, rootDir, isEjecting) => {
1919

2020
const config = {
2121
collectCoverageFrom: ['src/**/*.{js,jsx}'],
22-
moduleFileExtensions: ['jsx', 'js', 'json'],
2322
moduleNameMapper: {
2423
'^.+\\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': resolve('config/jest/FileStub.js'),
2524
'^.+\\.css$': resolve('config/jest/CSSStub.js')
@@ -35,7 +34,9 @@ module.exports = (resolve, rootDir, isEjecting) => {
3534
if (!isEjecting) {
3635
// This is unnecessary after ejecting because Jest
3736
// will just use .babelrc in the project folder.
38-
config.scriptPreprocessor = resolve('config/jest/transform.js');
37+
config.transform = {
38+
'^.+\\.(js|jsx)$': resolve('config/jest/transform.js'),
39+
};
3940
}
4041
return config;
4142
};

0 commit comments

Comments
 (0)