@@ -2,11 +2,7 @@ import * as readline from 'readline';
2
2
import _ from 'lodash' ;
3
3
import * as Rx from 'rxjs' ;
4
4
import { buffer , map } from 'rxjs/operators' ;
5
- import spawn from 'spawn-command' ;
6
-
7
- // Increasing timeout for these tests as sometimes it exceeded
8
- // in the CI when running on macOS / Windows (default is 5000ms)
9
- jest . setTimeout ( 10000 ) ;
5
+ import { spawn } from 'child_process' ;
10
6
11
7
const isWindows = process . platform === 'win32' ;
12
8
const createKillMessage = ( prefix : string ) =>
@@ -17,14 +13,17 @@ const createKillMessage = (prefix: string) =>
17
13
* Returns observables for its combined stdout + stderr output, close events, pid, and stdin stream.
18
14
*/
19
15
const run = ( args : string ) => {
20
- // TODO: This should only be transpiled once. Tests become 2.5x slower doing it in every `it`.
21
- const child = spawn ( 'ts-node --transpile-only ./concurrently.ts ' + args , {
16
+ // TODO: Optimally, this should only be transpiled once,
17
+ // e.g. bundle in `beforeAll` and then reuse here.
18
+ const child = spawn ( `node -r @swc-node/register ./concurrently.ts ${ args } ` , {
19
+ shell : true ,
22
20
cwd : __dirname ,
23
- env : Object . assign ( { } , process . env , {
21
+ env : {
22
+ ...process . env ,
24
23
// When upgrading from jest 23 -> 24, colors started printing in the test output.
25
24
// They are forcibly disabled here
26
- FORCE_COLOR : 0 ,
27
- } ) ,
25
+ FORCE_COLOR : '0' ,
26
+ } ,
28
27
} ) ;
29
28
30
29
const stdout = readline . createInterface ( {
0 commit comments