diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 28c81d311ac..d0f22bdd934 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -26,7 +26,7 @@ "autoprefixer": "6.5.1", "babel-core": "6.17.0", "babel-eslint": "7.0.0", - "babel-jest": "16.0.0", + "babel-jest": "17.0.2", "babel-loader": "6.2.7", "babel-preset-react-app": "^1.0.0", "case-sensitive-paths-webpack-plugin": "1.1.4", @@ -50,7 +50,7 @@ "gzip-size": "3.0.0", "html-webpack-plugin": "2.24.0", "http-proxy-middleware": "0.17.2", - "jest": "16.0.2", + "jest": "17.0.2", "json-loader": "0.5.4", "object-assign": "4.1.0", "path-exists": "2.1.0", diff --git a/packages/react-scripts/utils/createJestConfig.js b/packages/react-scripts/utils/createJestConfig.js index df0238f2587..38bef100623 100644 --- a/packages/react-scripts/utils/createJestConfig.js +++ b/packages/react-scripts/utils/createJestConfig.js @@ -19,7 +19,6 @@ module.exports = (resolve, rootDir, isEjecting) => { const config = { collectCoverageFrom: ['src/**/*.{js,jsx}'], - moduleFileExtensions: ['jsx', 'js', 'json'], moduleNameMapper: { '^.+\\.(ico|jpg|jpeg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm|wav|mp3|m4a|aac|oga)$': resolve('config/jest/FileStub.js'), '^.+\\.css$': resolve('config/jest/CSSStub.js') @@ -35,7 +34,9 @@ module.exports = (resolve, rootDir, isEjecting) => { if (!isEjecting) { // This is unnecessary after ejecting because Jest // will just use .babelrc in the project folder. - config.scriptPreprocessor = resolve('config/jest/transform.js'); + config.transform = { + '^.+\\.(js|jsx)$': resolve('config/jest/transform.js'), + }; } return config; };