diff --git a/packages/react-scripts/scripts/utils/createJestConfig.js b/packages/react-scripts/scripts/utils/createJestConfig.js index c5886ce0c..82d586c84 100644 --- a/packages/react-scripts/scripts/utils/createJestConfig.js +++ b/packages/react-scripts/scripts/utils/createJestConfig.js @@ -34,9 +34,11 @@ module.exports = (resolve, rootDir) => { testEnvironment: 'node', testURL: 'http://localhost', transform: { + '^.+\\.(js|jsx|ts|tsx)$': resolve('config/jest/typescriptTransform.js'), '^.+\\.css$': resolve('config/jest/cssTransform.js'), - '^.+\\.tsx?$': resolve('config/jest/typescriptTransform.js'), - '^(?!.*\\.(js|jsx|css|json)$)': resolve('config/jest/fileTransform.js'), + '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': resolve( + 'config/jest/fileTransform.js' + ), }, transformIgnorePatterns: [ '[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$', @@ -60,7 +62,7 @@ module.exports = (resolve, rootDir) => { 'ts-jest': { tsConfigFile: paths.appTsTestConfig, }, - } + }, }; if (rootDir) { config.rootDir = rootDir;