From 5bc5076451d12a7b642fa7cda7eedb78c194bf1f Mon Sep 17 00:00:00 2001 From: Ro Savage Date: Sun, 28 May 2017 20:39:56 +1200 Subject: [PATCH] Revert to modulePathIgnorePatterns to fix issue with watchers crashing jest --- packages/react-scripts/scripts/utils/createJestConfig.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index 13ae8b30411..d998bdd7208 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -26,10 +26,11 @@ module.exports = (resolve, rootDir, isEjecting) => { collectCoverageFrom: ['src/**/*.{js,jsx}'], setupFiles: [resolve('config/polyfills.js')], setupTestFrameworkScriptFile: setupTestsFile, - testMatch: [ - '/src/**/__tests__/**/*.js?(x)', - '/src/**/?(*.)(spec|test).js?(x)', - ], + // the `testMatches` option currently watches node_modules + // Which causes crashes on large projects on MacOS. + // Once this is fixes we can change from `modulePathIgnorePatterns` to `testMatches`. + // See facebook/jest/issues/1767 & facebookincubator/create-react-app/pull/2395 + modulePathIgnorePatterns: ['\/(?!src).*\/.*'], testEnvironment: 'node', testURL: 'http://localhost', transform: {