@@ -237,7 +237,7 @@ switch (config.frameworkSettings.testSettings.testFramework) {
237
237
const tsPathsEsmLoaderPath = new URL ( import . meta. resolve ( 'ts-paths-esm-loader' ) ) . pathname ;
238
238
const cliPath = findFilePath ( [ 'node_modules/jasmine/bin/jasmine.js' ] ) ;
239
239
const jasmineConfigPath = new URL ( import . meta. resolve ( './jasmine/config.json' ) ) . pathname ;
240
- const cliArgs = [ cliPath , `--config=${ jasmineConfigPath } ` ] ;
240
+ const cliArgs = [ `--config=${ jasmineConfigPath } ` ] ;
241
241
242
242
switch ( reporter ) {
243
243
case 'json' : throw new Error ( 'Jasmine does not have default JSON reporter' ) ;
@@ -265,20 +265,26 @@ switch (config.frameworkSettings.testSettings.testFramework) {
265
265
case 'xunit' : throw new Error ( 'Jasmine does not have xUnit reporter' ) ;
266
266
}
267
267
268
- spawnSync ( 'node' , cliArgs , {
268
+ const child = fork ( cliPath , cliArgs , {
269
269
stdio : 'inherit' ,
270
270
env : {
271
271
...process . env ,
272
272
NODE_OPTIONS : `--loader=${ tsPathsEsmLoaderPath } --experimental-specifier-resolution=node --no-warnings` ,
273
273
} ,
274
+ execArgv : [ '--inspect=12016' ] ,
275
+ } ) ;
276
+
277
+ // Handle child process events (optional)
278
+ child . on ( 'exit' , ( code ) => {
279
+ console . log ( `Child process exited with code ${ code } ` ) ;
274
280
} ) ;
275
281
276
282
break ;
277
283
}
278
284
case 'mocha' : {
279
285
const tsPathsEsmLoaderPath = new URL ( import . meta. resolve ( 'ts-paths-esm-loader' ) ) . pathname ;
280
286
const cliPath = findFilePath ( [ 'node_modules/mocha/bin/mocha.js' ] ) ;
281
- const cliArgs = [ cliPath , '**/*.test.?(m){ts,js}' ] ;
287
+ const cliArgs = [ '**/*.test.?(m){ts,js}' ] ;
282
288
283
289
switch ( reporter ) {
284
290
case 'json' : {
@@ -307,12 +313,18 @@ switch (config.frameworkSettings.testSettings.testFramework) {
307
313
}
308
314
}
309
315
310
- spawnSync ( 'node' , cliArgs , {
316
+ const child = fork ( cliPath , cliArgs , {
311
317
stdio : 'inherit' ,
312
318
env : {
313
319
...process . env ,
314
320
NODE_OPTIONS : `--loader=${ tsPathsEsmLoaderPath } --experimental-specifier-resolution=node --no-warnings` ,
315
- }
321
+ } ,
322
+ execArgv : [ '--inspect=12016' ] ,
323
+ } ) ;
324
+
325
+ // Handle child process events (optional)
326
+ child . on ( 'exit' , ( code ) => {
327
+ console . log ( `Child process exited with code ${ code } ` ) ;
316
328
} ) ;
317
329
318
330
break ;
@@ -322,7 +334,7 @@ switch (config.frameworkSettings.testSettings.testFramework) {
322
334
const tsPathsEsmLoaderPath = new URL ( import . meta. resolve ( 'ts-paths-esm-loader' ) ) . pathname ;
323
335
const cliPath = join ( new URL ( import . meta. resolve ( 'jest-cli' ) ) . pathname , '..' , '..' , 'bin' , 'jest.js' ) ;
324
336
const testMatch = '\\.test\\.(ts|js)' ;
325
- const cliArgs = [ cliPath ] ;
337
+ const cliArgs = [ ] ;
326
338
327
339
switch ( reporter ) {
328
340
case 'json' : throw new Error ( 'Jest does not have default JSON reporter' ) ;
@@ -367,12 +379,18 @@ switch (config.frameworkSettings.testSettings.testFramework) {
367
379
}
368
380
}
369
381
370
- spawnSync ( 'node' , cliArgs , {
382
+ const child = fork ( cliPath , cliArgs , {
371
383
stdio : 'inherit' ,
372
384
env : {
373
385
...process . env ,
374
386
NODE_OPTIONS : `--loader=${ tsPathsEsmLoaderPath } --experimental-vm-modules --no-warnings` ,
375
- }
387
+ } ,
388
+ execArgv : [ '--inspect=12016' ] ,
389
+ } ) ;
390
+
391
+ // Handle child process events (optional)
392
+ child . on ( 'exit' , ( code ) => {
393
+ console . log ( `Child process exited with code ${ code } ` ) ;
376
394
} ) ;
377
395
378
396
break ;
0 commit comments