diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index abfd92c8d3c..786f4d0bf31 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -14,7 +14,7 @@ const paths = require('../../config/paths'); module.exports = (resolve, rootDir, isEjecting) => { // Use this instead of `paths.testsSetup` to avoid putting // an absolute filename into configuration after ejecting. - const setupTestsMatches = paths.testsSetup.match(/src\/setupTests\.(.+)/); + const setupTestsMatches = paths.testsSetup.match(/src[/\\]setupTests\.(.+)/); const setupTestsFileExtension = (setupTestsMatches && setupTestsMatches[1]) || 'js'; const setupTestsFile = fs.existsSync(paths.testsSetup)