File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -21,11 +21,14 @@ packageJson.jest = jestOverrides;
2121// override createJestConfig in memory
2222require . cache [ require . resolve ( createJestConfigPath ) ] . exports =
2323 ( ) => overrides . jest ( rewireJestConfig ( config ) ) ;
24- // Passing the --scripts-version on to the original test script can result
24+ // Passing the --scripts-version and --config-overrides on to the original test script can result
2525// in the test script rejecting it as an invalid option. So strip it out of
2626// the command line arguments before invoking the test script.
2727if ( paths . customScriptsIndex > - 1 ) {
2828 process . argv . splice ( paths . customScriptsIndex , 2 ) ;
2929}
30+ if ( paths . configOverridesIndex > - 1 ) {
31+ process . argv . splice ( paths . configOverridesIndex , 2 ) ;
32+ }
3033
3134module . exports = require ( createJestConfigPath ) ;
Original file line number Diff line number Diff line change @@ -17,9 +17,10 @@ var config_overrides = customPath
1717 : `${ projectDir } /config-overrides` ;
1818const co_index = process . argv . indexOf ( '--config-overrides' ) ;
1919
20+ var has_co_argument = false ;
2021if ( co_index > - 1 && co_index + 1 <= process . argv . length ) {
22+ has_co_argument = true ;
2123 config_overrides = path . resolve ( process . argv [ co_index + 1 ] ) ;
22- process . argv . splice ( co_index , 2 ) ;
2324}
2425
2526const scriptVersion = custom_scripts || 'react-scripts' ;
@@ -33,5 +34,6 @@ const paths = require(modulePath + '/config/paths');
3334module . exports = Object . assign ( {
3435 scriptVersion : modulePath ,
3536 configOverrides : config_overrides ,
36- customScriptsIndex : ( custom_scripts ? cs_index : - 1 )
37+ customScriptsIndex : ( custom_scripts ? cs_index : - 1 ) ,
38+ configOverridesIndex : ( has_co_argument ? co_index : - 1 ) ,
3739} , paths ) ;
You can’t perform that action at this time.
0 commit comments