From 7528a823892781bfe200befc9440f3615f2fd741 Mon Sep 17 00:00:00 2001 From: Tom Dunlap Date: Mon, 13 Mar 2017 15:40:27 +0000 Subject: [PATCH 1/2] Only run tests in /src (#544) * updates Jest to 19.0.2 * removes testPathIgnorePatterns from jest config * adds testMatch to jest config to only match files in src --- packages/react-scripts/package.json | 2 +- packages/react-scripts/scripts/utils/createJestConfig.js | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 59542d4361d..1b9d73bc65a 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -49,7 +49,7 @@ "fs-extra": "0.30.0", "html-webpack-plugin": "2.28.0", "http-proxy-middleware": "0.17.3", - "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/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index 5ba7fd16cb2..db5d3566e29 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -25,8 +25,9 @@ module.exports = (resolve, rootDir, isEjecting) => { collectCoverageFrom: ['src/**/*.{js,jsx}'], setupFiles: [resolve('config/polyfills.js')], setupTestFrameworkScriptFile: setupTestsFile, - testPathIgnorePatterns: [ - '[/\\\\](build|docs|node_modules|scripts)[/\\\\]', + testMatch: [ + '/src/**/__tests__/**/*.js?(x)', + '/src/**/?(*.)(spec|test).js?(x)' ], testEnvironment: 'node', testURL: 'http://localhost', From 899c68d13b3464c40fa0e1be50205fde700c23ec Mon Sep 17 00:00:00 2001 From: Tom Dunlap Date: Mon, 13 Mar 2017 21:18:53 +0000 Subject: [PATCH 2/2] Bump babel-jest to 19.0.0 to match jest 19.0.2 --- packages/react-scripts/package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-scripts/package.json b/packages/react-scripts/package.json index 1b9d73bc65a..3ee249fac71 100644 --- a/packages/react-scripts/package.json +++ b/packages/react-scripts/package.json @@ -26,7 +26,7 @@ "autoprefixer": "6.7.5", "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-alpha.3", "babel-preset-react-app": "^2.1.1", "babel-runtime": "^6.20.0",