Skip to content

Commit

Permalink
Add .cjs and .mjs files support to test runner (#8768)
Browse files Browse the repository at this point in the history
  • Loading branch information
ai authored Apr 4, 2020
1 parent edc671e commit bc41892
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/react-scripts/scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ module.exports = (resolve, rootDir, isEjecting) => {
],
testEnvironment: 'jest-environment-jsdom-fourteen',
transform: {
'^.+\\.(js|jsx|ts|tsx)$': isEjecting
'^.+\\.(js|jsx|mjs|cjs|ts|tsx)$': isEjecting
? '<rootDir>/node_modules/babel-jest'
: resolve('config/jest/babelTransform.js'),
'^.+\\.css$': resolve('config/jest/cssTransform.js'),
'^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': resolve(
'^(?!.*\\.(js|jsx|mjs|cjs|ts|tsx|css|json)$)': resolve(
'config/jest/fileTransform.js'
),
},
transformIgnorePatterns: [
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|ts|tsx)$',
'[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$',
],
modulePaths: modules.additionalModulePaths || [],
Expand Down

0 comments on commit bc41892

Please sign in to comment.