File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
packages/react-scripts/scripts Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -39,6 +39,7 @@ prompt(
3939 path . join ( 'config' , 'jest' , 'FileStub.js' ) ,
4040 path . join ( 'scripts' , 'build.js' ) ,
4141 path . join ( 'scripts' , 'start.js' ) ,
42+ path . join ( 'scripts' , 'test.js' ) ,
4243 path . join ( 'scripts' , 'utils' , 'checkRequiredFiles.js' ) ,
4344 path . join ( 'scripts' , 'utils' , 'chrome.applescript' ) ,
4445 path . join ( 'scripts' , 'utils' , 'getClientEnvironment.js' ) ,
@@ -98,7 +99,6 @@ prompt(
9899 delete appPackage . scripts [ 'eject' ] ;
99100 Object . keys ( appPackage . scripts ) . forEach ( function ( key ) {
100101 appPackage . scripts [ key ] = appPackage . scripts [ key ]
101- . replace ( / r e a c t - s c r i p t s t e s t / g, 'jest --watch' )
102102 . replace ( / r e a c t - s c r i p t s ( \w + ) / g, 'node scripts/$1.js' ) ;
103103 } ) ;
104104
Original file line number Diff line number Diff line change 1+ // @remove -on-eject-begin
12/**
23 * Copyright (c) 2015-present, Facebook, Inc.
34 * All rights reserved.
67 * LICENSE file in the root directory of this source tree. An additional grant
78 * of patent rights can be found in the PATENTS file in the same directory.
89 */
10+ // @remove -on-eject-end
911
1012process . env . NODE_ENV = 'test' ;
1113process . env . PUBLIC_URL = '' ;
@@ -16,7 +18,6 @@ process.env.PUBLIC_URL = '';
1618// https://github.com/motdotla/dotenv
1719require ( 'dotenv' ) . config ( { silent : true } ) ;
1820
19- const createJestConfig = require ( './utils/createJestConfig' ) ;
2021const jest = require ( 'jest' ) ;
2122const path = require ( 'path' ) ;
2223const paths = require ( '../config/paths' ) ;
@@ -28,10 +29,14 @@ if (!process.env.CI) {
2829 argv . push ( '--watch' ) ;
2930}
3031
32+ // @remove -on-eject-begin
33+ // This is not necessary after eject because we embed config into package.json.
34+ const createJestConfig = require ( './utils/createJestConfig' ) ;
3135argv . push ( '--config' , JSON . stringify ( createJestConfig (
3236 relativePath => path . resolve ( __dirname , '..' , relativePath ) ,
3337 path . resolve ( paths . appSrc , '..' ) ,
3438 false
3539) ) ) ;
40+ // @remove -on-eject-end
3641
3742jest . run ( argv ) ;
You can’t perform that action at this time.
0 commit comments