@@ -12,13 +12,13 @@ import { map } from 'rxjs/operators';
12
12
import stringArgv from 'string-argv' ;
13
13
14
14
const isWindows = process . platform === 'win32' ;
15
- const createKillMessage = ( prefix : string , signal : 'SIGTERM' | 'SIGINT' ) => {
15
+ const createKillMessage = ( prefix : string , signal : 'SIGTERM' | 'SIGINT' | string ) => {
16
16
const map : Record < string , string | number > = {
17
17
SIGTERM : isWindows ? 1 : '(SIGTERM|143)' ,
18
18
// Could theoretically be anything (e.g. 0) if process has SIGINT handler
19
19
SIGINT : isWindows ? '(3221225786|0)' : '(SIGINT|130|0)' ,
20
20
} ;
21
- return new RegExp ( escapeRegExp ( prefix ) + ' exited with code ' + map [ signal ] ) ;
21
+ return new RegExp ( escapeRegExp ( prefix ) + ' exited with code ' + ( map [ signal ] ?? signal ) ) ;
22
22
} ;
23
23
24
24
let tmpDir : string ;
@@ -193,7 +193,10 @@ describe('exiting conditions', () => {
193
193
? // '^C' is echoed by read-echo.js (also happens without the wrapper)
194
194
'[0] ^Cnode fixtures/read-echo.js'
195
195
: '[0] node fixtures/read-echo.js' ,
196
- 'SIGINT'
196
+ // TODO: Flappy value due to race condition, sometimes killed by concurrently (exit code 1),
197
+ // sometimes terminated on its own (exit code 0).
198
+ // Related issue: https://github.com/open-cli-tools/concurrently/issues/283
199
+ isWindows ? '(3221225786|0|1)' : 'SIGINT'
197
200
)
198
201
)
199
202
) ;
0 commit comments