File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ export default function (originOpts: any = {}) {
6868 } ) ;
6969
7070 return new Promise ( ( resolve , reject ) => {
71+ const originEnv = process . env . NODE_ENV ;
72+ process . env . NODE_ENV = 'test' ;
73+
7174 runCLI (
7275 {
7376 config : JSON . stringify ( config ) ,
@@ -86,6 +89,9 @@ export default function (originOpts: any = {}) {
8689 } )
8790 . catch ( ( e ) => {
8891 console . log ( e ) ;
92+ } )
93+ . then ( ( ) => {
94+ process . env . NODE_ENV = originEnv ;
8995 } ) ;
9096 } ) ;
9197}
Original file line number Diff line number Diff line change @@ -17,4 +17,8 @@ describe('basic', () => {
1717 const { container } = render ( < p data-test = "bamboo" /> ) ;
1818 expect ( container . querySelector ( 'p' ) ) . toHaveAttribute ( 'data-test' , 'bamboo' ) ;
1919 } ) ;
20+
21+ it ( 'correct env' , ( ) => {
22+ expect ( process . env . NODE_ENV ) . toEqual ( 'test' ) ;
23+ } ) ;
2024} ) ;
You can’t perform that action at this time.
0 commit comments