File tree Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Expand file tree Collapse file tree 1 file changed +27
-1
lines changed Original file line number Diff line number Diff line change 1- // TODO need help for customization
1+ process . env . BABEL_ENV = 'test' ;
2+ process . env . NODE_ENV = 'test' ;
3+ process . env . PUBLIC_URL = '' ;
4+
5+ require ( 'react-scripts/config/env' ) ;
6+
7+ const patchModule = require ( './utils/cache' ) ;
8+
9+ const fs = require ( 'fs-extra' ) ;
10+ const path = require ( 'path' ) ;
11+
12+ const chalk = require ( 'chalk' ) ;
13+ const appPath = require ( 'react-scripts/config/paths' ) . appPath ;
14+ const webpackMonkeyPath = path . resolve ( appPath , 'webpack.monkey.js' ) ;
15+
16+ require ( 'react-scripts/config/jest/babelTransform.js' )
17+
18+ if ( fs . existsSync ( webpackMonkeyPath ) ) {
19+ console . log ( chalk . yellow ( 'WARNING! .babelrc file is enabled!' ) ) ;
20+ const babelJest = require ( 'babel-jest' ) ;
21+ patchModule ( 'react-scripts/config/jest/babelTransform.js' , babelJest . createTransformer ( {
22+ presets : [ require . resolve ( 'babel-preset-react-app' ) ] ,
23+ babelrc : true ,
24+ configFile : false ,
25+ } ) ) ;
26+ }
27+
228require ( 'react-scripts/scripts/test' ) ;
You can’t perform that action at this time.
0 commit comments