Skip to content
This repository was archived by the owner on Jan 26, 2019. It is now read-only.

Commit 9c17cd9

Browse files
committed
added isejecting
1 parent 353282d commit 9c17cd9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const fs = require('fs');
1111
const chalk = require('chalk');
1212
const paths = require('../../config/paths');
1313

14-
module.exports = (resolve, rootDir) => {
14+
module.exports = (resolve, rootDir, isEjecting) => {
1515
// Use this instead of `paths.testsSetup` to avoid putting
1616
// an absolute filename into configuration after ejecting.
1717
const setupTestsFile = fs.existsSync(paths.testsSetup)
@@ -31,6 +31,9 @@ module.exports = (resolve, rootDir) => {
3131
testEnvironment: 'node',
3232
testURL: 'http://localhost',
3333
transform: {
34+
'^.+\\.(js|jsx)$': isEjecting
35+
? '<rootDir>/node_modules/babel-jest'
36+
: resolve('config/jest/babelTransform.js'),
3437
'^.+\\.tsx?$': resolve('config/jest/typescriptTransform.js'),
3538
'^.+\\.css$': resolve('config/jest/cssTransform.js'),
3639
'^(?!.*\\.(js|jsx|mjs|css|json)$)': resolve(

0 commit comments

Comments
 (0)