From 7528a823892781bfe200befc9440f3615f2fd741 Mon Sep 17 00:00:00 2001 From: Tom Dunlap Date: Mon, 13 Mar 2017 15:40:27 +0000 Subject: [PATCH] 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',