From 0a5f0bb4875a2cffa9194aef889c49fbaa80f11c Mon Sep 17 00:00:00 2001 From: Ville Immonen Date: Mon, 21 Nov 2016 23:00:39 +0200 Subject: [PATCH] Upgrade Jest to 17.0 (#1078) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Replace `scriptPreprocessor` config with `transform`. * Also remove `moduleFileExtensions` which has been redundant since 16.0 (`['js', 'json', 'jsx', 'node’]` is the default) --- packages/react-scripts/package.json | 4 ++-- packages/react-scripts/utils/createJestConfig.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) 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; };