@@ -98,6 +98,7 @@ const configs = [
98
98
] ;
99
99
100
100
const configFileURI = pathToFileURL ( findFilePath ( configs ) ) ;
101
+ const debugPort = 12016 ;
101
102
102
103
let config ;
103
104
@@ -217,13 +218,20 @@ switch (config.frameworkSettings.testSettings.testFramework) {
217
218
218
219
// cliArgs.push('--ui'); // TODO: make it an option
219
220
221
+ const execArgv = [ ] ;
222
+ const inspector = await import ( 'inspector' ) ;
223
+
224
+ if ( inspector . url ( ) !== undefined ) {
225
+ execArgv . push ( `--inspect=${ debugPort } ` ) ;
226
+ }
227
+
220
228
const child = fork ( cliPath , cliArgs , {
221
229
stdio : 'inherit' ,
222
230
env : {
223
231
...process . env ,
224
232
NODE_OPTIONS : `--loader=${ tsPathsEsmLoaderPath } --experimental-specifier-resolution=node --no-warnings` ,
225
233
} ,
226
- execArgv : [ '--inspect=12016' ] ,
234
+ execArgv,
227
235
} ) ;
228
236
229
237
// Handle child process events (optional)
@@ -265,13 +273,20 @@ switch (config.frameworkSettings.testSettings.testFramework) {
265
273
case 'xunit' : throw new Error ( 'Jasmine does not have xUnit reporter' ) ;
266
274
}
267
275
276
+ const execArgv = [ ] ;
277
+ const inspector = await import ( 'inspector' ) ;
278
+
279
+ if ( inspector . url ( ) !== undefined ) {
280
+ execArgv . push ( `--inspect=${ debugPort } ` ) ;
281
+ }
282
+
268
283
const child = fork ( cliPath , cliArgs , {
269
284
stdio : 'inherit' ,
270
285
env : {
271
286
...process . env ,
272
287
NODE_OPTIONS : `--loader=${ tsPathsEsmLoaderPath } --experimental-specifier-resolution=node --no-warnings` ,
273
288
} ,
274
- execArgv : [ '--inspect=12016' ] ,
289
+ execArgv,
275
290
} ) ;
276
291
277
292
// Handle child process events (optional)
@@ -313,13 +328,20 @@ switch (config.frameworkSettings.testSettings.testFramework) {
313
328
}
314
329
}
315
330
331
+ const execArgv = [ ] ;
332
+ const inspector = await import ( 'inspector' ) ;
333
+
334
+ if ( inspector . url ( ) !== undefined ) {
335
+ execArgv . push ( `--inspect=${ debugPort } ` ) ;
336
+ }
337
+
316
338
const child = fork ( cliPath , cliArgs , {
317
339
stdio : 'inherit' ,
318
340
env : {
319
341
...process . env ,
320
342
NODE_OPTIONS : `--loader=${ tsPathsEsmLoaderPath } --experimental-specifier-resolution=node --no-warnings` ,
321
343
} ,
322
- execArgv : [ '--inspect=12016' ] ,
344
+ execArgv,
323
345
} ) ;
324
346
325
347
// Handle child process events (optional)
@@ -379,13 +401,20 @@ switch (config.frameworkSettings.testSettings.testFramework) {
379
401
}
380
402
}
381
403
404
+ const execArgv = [ ] ;
405
+ const inspector = await import ( 'inspector' ) ;
406
+
407
+ if ( inspector . url ( ) !== undefined ) {
408
+ execArgv . push ( `--inspect=${ debugPort } ` ) ;
409
+ }
410
+
382
411
const child = fork ( cliPath , cliArgs , {
383
412
stdio : 'inherit' ,
384
413
env : {
385
414
...process . env ,
386
415
NODE_OPTIONS : `--loader=${ tsPathsEsmLoaderPath } --experimental-vm-modules --no-warnings` ,
387
416
} ,
388
- execArgv : [ '--inspect=12016' ] ,
417
+ execArgv,
389
418
} ) ;
390
419
391
420
// Handle child process events (optional)
0 commit comments