Skip to content

Commit 5bc5076

Browse files
committed
Revert to modulePathIgnorePatterns to fix issue with watchers crashing jest
1 parent 3f34238 commit 5bc5076

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

packages/react-scripts/scripts/utils/createJestConfig.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,11 @@ module.exports = (resolve, rootDir, isEjecting) => {
2626
collectCoverageFrom: ['src/**/*.{js,jsx}'],
2727
setupFiles: [resolve('config/polyfills.js')],
2828
setupTestFrameworkScriptFile: setupTestsFile,
29-
testMatch: [
30-
'<rootDir>/src/**/__tests__/**/*.js?(x)',
31-
'<rootDir>/src/**/?(*.)(spec|test).js?(x)',
32-
],
29+
// the `testMatches` option currently watches node_modules
30+
// Which causes crashes on large projects on MacOS.
31+
// Once this is fixes we can change from `modulePathIgnorePatterns` to `testMatches`.
32+
// See facebook/jest/issues/1767 & facebookincubator/create-react-app/pull/2395
33+
modulePathIgnorePatterns: ['<rootDir>\/(?!src).*\/.*'],
3334
testEnvironment: 'node',
3435
testURL: 'http://localhost',
3536
transform: {

0 commit comments

Comments
 (0)