Skip to content

Commit

Permalink
There is no automatic babel-jest discovery now that we use transsform
Browse files Browse the repository at this point in the history
  • Loading branch information
gaearon committed Dec 7, 2016
1 parent cddbe73 commit 0d79330
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions packages/react-scripts/utils/createJestConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ module.exports = (resolve, rootDir, isEjecting) => {
testEnvironment: 'node',
testURL: 'http://localhost',
transform: {
'^.+\\.(js|jsx)$': isEjecting ?
'<rootDir>/node_modules/babel-jest'
: resolve('config/jest/babelTransform.js'),
'^.+\\.css$': resolve('config/jest/cssTransform.js'),
'^(?!.*\\.(js|jsx|css|json)$)': resolve('config/jest/fileTransform.js'),
},
Expand All @@ -39,12 +42,5 @@ module.exports = (resolve, rootDir, isEjecting) => {
if (rootDir) {
config.rootDir = rootDir;
}
if (!isEjecting) {
// This is unnecessary after ejecting because Jest
// will just use .babelrc in the project folder.
Object.assign(config.transform, {
'^.+\\.(js|jsx)$': resolve('config/jest/babelTransform.js'),
});
}
return config;
};

0 comments on commit 0d79330

Please sign in to comment.