Skip to content

Commit bc41892

Browse files
authored
Add .cjs and .mjs files support to test runner (facebook#8768)
1 parent edc671e commit bc41892

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,16 @@ module.exports = (resolve, rootDir, isEjecting) => {
4040
],
4141
testEnvironment: 'jest-environment-jsdom-fourteen',
4242
transform: {
43-
'^.+\\.(js|jsx|ts|tsx)$': isEjecting
43+
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': isEjecting
4444
? '<rootDir>/node_modules/babel-jest'
4545
: resolve('config/jest/babelTransform.js'),
4646
'^.+\\.css$': resolve('config/jest/cssTransform.js'),
47-
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': resolve(
47+
'^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': resolve(
4848
'config/jest/fileTransform.js'
4949
),
5050
},
5151
transformIgnorePatterns: [
52-
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
52+
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$',
5353
'^.+\\.module\\.(css|sass|scss)$',
5454
],
5555
modulePaths: modules.additionalModulePaths || [],

0 commit comments

Comments
 (0)