File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -114,7 +114,7 @@ const readResultsAndExit = (
114114) = > {
115115 const code = ! result || result . success ? 0 : globalConfig . testFailureExitCode ;
116116
117- process . on ( 'exit' , ( ) => exit ( code ) ) ;
117+ process . on ( 'exit' , ( ) => ( process . exitCode = code ) ) ;
118118
119119 if ( globalConfig . forceExit ) {
120120 exit ( code ) ;
Original file line number Diff line number Diff line change @@ -11,7 +11,6 @@ import type {Argv} from 'types/Argv';
1111import type { EnvironmentClass } from 'types/Environment' ;
1212
1313import chalk from 'chalk' ;
14- import exit from 'exit' ;
1514import os from 'os' ;
1615import path from 'path' ;
1716import yargs from 'yargs' ;
@@ -43,7 +42,7 @@ export function run(cliArgv?: Argv, cliInfo?: Array<string>) {
4342
4443 if ( argv . help ) {
4544 yargs . showHelp ( ) ;
46- process . on ( 'exit' , ( ) => exit ( 1 ) ) ;
45+ process . on ( 'exit' , ( ) => ( process . exitCode = 1 ) ) ;
4746 return ;
4847 }
4948
@@ -54,7 +53,7 @@ export function run(cliArgv?: Argv, cliInfo?: Array<string>) {
5453
5554 if ( ! argv . _ . length ) {
5655 console . log ( 'Please provide a path to a script. (See --help for details)' ) ;
57- process . on ( 'exit' , ( ) => exit ( 1 ) ) ;
56+ process . on ( 'exit' , ( ) => ( process . exitCode = 1 ) ) ;
5857 return ;
5958 }
6059
@@ -93,6 +92,6 @@ export function run(cliArgv?: Argv, cliInfo?: Array<string>) {
9392 } )
9493 . catch ( e => {
9594 console . error ( chalk . red ( e . stack || e ) ) ;
96- process . on ( 'exit' , ( ) => exit ( 1 ) ) ;
95+ process . on ( 'exit' , ( ) => ( process . exitCode = 1 ) ) ;
9796 } ) ;
9897}
You can’t perform that action at this time.
0 commit comments