File tree Expand file tree Collapse file tree
packages/cli/tests/commands Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -136,13 +136,19 @@ describe('executePipeline', () => {
136136 } ) ;
137137
138138 it ( 'throws on missing config' , async ( ) => {
139- await assert . rejects (
140- ( ) => executePipeline ( { cwd : tmpDir } ) ,
141- ( err : Error ) => {
142- assert . ok ( err . message . length > 0 ) ;
143- return true ;
144- } ,
145- ) ;
139+ const originalHome = process . env [ 'HOME' ] ;
140+ process . env [ 'HOME' ] = tmpDir ;
141+ try {
142+ await assert . rejects (
143+ ( ) => executePipeline ( { cwd : tmpDir } ) ,
144+ ( err : Error ) => {
145+ assert . ok ( err . message . length > 0 ) ;
146+ return true ;
147+ } ,
148+ ) ;
149+ } finally {
150+ process . env [ 'HOME' ] = originalHome ;
151+ }
146152 } ) ;
147153
148154 it ( 'throws on invalid YAML syntax' , async ( ) => {
Original file line number Diff line number Diff line change @@ -132,10 +132,16 @@ describe('devw explain', () => {
132132 } ) ;
133133
134134 it ( 'errors when no config exists' , async ( ) => {
135- const result = await run ( [ 'explain' ] , tmpDir ) ;
136-
137- assert . equal ( result . exitCode , 1 ) ;
138- assert . ok ( result . stderr . includes ( 'No devw configuration found' ) ) ;
135+ const originalHome = process . env [ 'HOME' ] ;
136+ process . env [ 'HOME' ] = tmpDir ;
137+ try {
138+ const result = await run ( [ 'explain' ] , tmpDir ) ;
139+
140+ assert . equal ( result . exitCode , 1 ) ;
141+ assert . ok ( result . stderr . includes ( 'No devw configuration found' ) ) ;
142+ } finally {
143+ process . env [ 'HOME' ] = originalHome ;
144+ }
139145 } ) ;
140146
141147 it ( 'errors when --tool is not configured' , async ( ) => {
You can’t perform that action at this time.
0 commit comments