From f8bfd1a77c70ba3a19820c6129518925f6c1e116 Mon Sep 17 00:00:00 2001 From: Rogelio Guzman Date: Mon, 15 May 2017 11:35:18 -0700 Subject: [PATCH] Update to Jest 19 (#1614) * Upgrade to Jest 19 * Use testMatch * Correct version --- package.json | 4 ++-- scripts/utils/createJestConfig.js | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 030484e2214..2d100ea0e6d 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ "autoprefixer": "6.7.7", "babel-core": "6.23.1", "babel-eslint": "7.1.1", - "babel-jest": "18.0.0", + "babel-jest": "19.0.0", "babel-loader": "7.0.0", "babel-preset-react-app": "^2.1.1", "babel-runtime": "^6.20.0", @@ -49,7 +49,7 @@ "html-webpack-plugin": "2.28.0", "http-proxy-middleware": "0.17.3", "inquirer": "3.0.6", - "jest": "18.1.0", + "jest": "19.0.2", "object-assign": "4.1.1", "postcss-loader": "1.3.3", "promise": "7.1.1", diff --git a/scripts/utils/createJestConfig.js b/scripts/utils/createJestConfig.js index 28382b0f78f..e41334b3bc8 100644 --- a/scripts/utils/createJestConfig.js +++ b/scripts/utils/createJestConfig.js @@ -25,7 +25,7 @@ module.exports = (resolve, rootDir, isEjecting) => { collectCoverageFrom: ['src/**/*.{js,jsx}'], setupFiles: [resolve('config/polyfills.js')], setupTestFrameworkScriptFile: setupTestsFile, - testPathIgnorePatterns: [ + testMatch: [ // Ignore the following directories: // build // - the build output directory @@ -37,7 +37,8 @@ module.exports = (resolve, rootDir, isEjecting) => { // - ignore tests in dependencies // scripts // - directory generated upon eject - '[/\\\\](build|\\.cache|docs|node_modules|scripts)[/\\\\]', + '/!(build|docs|node_modules|scripts)/**/__tests__/**/*.js?(x)', + '/!(build|docs|node_modules|scripts)/**/?(*.)(spec|test).js?(x)', ], testEnvironment: 'node', testURL: 'http://localhost',