Skip to content

Commit

Permalink
Revert removing babelTransform.js (#350)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danylo Markov authored and timarney committed Jan 10, 2019
1 parent 4475974 commit 2383e07
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/react-app-rewired/scripts/utils/babelTransform.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
const babelJest = require('babel-jest');

module.exports = babelJest.createTransformer({
presets: [require.resolve('babel-preset-react-app')],
plugins: [],
babelrc: true
});
6 changes: 6 additions & 0 deletions packages/react-app-rewired/scripts/utils/rewireJestConfig.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
'use strict';

const path = require('path');
const paths = require('./paths');

module.exports = (config) => {
Object.keys(config.transform).forEach((key) => {
if (config.transform[key].endsWith('babelTransform.js')) {
config.transform[key] = path.resolve(__dirname + '/babelTransform.js');
}
});
const overrides = Object.assign({}, require(paths.appPackageJson).jest);

// Jest configuration in package.json will be added to the the default config
Expand Down

0 comments on commit 2383e07

Please sign in to comment.