@@ -429,3 +429,52 @@ for (const isolation of ['none', 'process']) {
429429 assert . strictEqual ( child . status , 0 ) ;
430430 assert . strictEqual ( child . signal , null ) ;
431431}
432+
433+ {
434+ // Should not propagate --experimental-config-file option to sub test in isolation process
435+ const fixturePath = join ( testFixtures , 'options-propagation' ) ;
436+ const args = [
437+ '--test-reporter=tap' ,
438+ '--no-warnings' ,
439+ `--experimental-config-file=node.config.json` ,
440+ '--expose-internals' ,
441+ '--test' ,
442+ ] ;
443+ const child = spawnSync ( process . execPath , args , { cwd : fixturePath } ) ;
444+
445+ assert . strictEqual ( child . stderr . toString ( ) , '' ) ;
446+ const stdout = child . stdout . toString ( ) ;
447+
448+ assert . match ( stdout , / t e s t s 1 / ) ;
449+ assert . match ( stdout , / s u i t e s 0 / ) ;
450+ assert . match ( stdout , / p a s s 1 / ) ;
451+ assert . match ( stdout , / f a i l 0 / ) ;
452+ assert . match ( stdout , / c a n c e l l e d 0 / ) ;
453+ assert . match ( stdout , / s k i p p e d 0 / ) ;
454+ assert . match ( stdout , / t o d o 0 / ) ;
455+
456+
457+ assert . strictEqual ( child . status , 0 ) ;
458+ }
459+
460+ {
461+ if ( process . features . inspector ) {
462+ // https://github.com/nodejs/node/issues/58828
463+ // Should not print report twice when --experimental-test-coverage is set via config file
464+ const fixturePath = join ( testFixtures , 'options-propagation' ) ;
465+ const args = [
466+ '--test-reporter=tap' ,
467+ '--no-warnings' ,
468+ `--experimental-config-file=node.config.json` ,
469+ '--expose-internals' ,
470+ '--test' ,
471+ ] ;
472+
473+ const child = spawnSync ( process . execPath , args , { cwd : fixturePath } ) ;
474+ const stdout = child . stdout . toString ( ) ;
475+
476+ const coverageReportMatches = stdout . match ( / # s t a r t o f c o v e r a g e r e p o r t / g) ;
477+ assert . strictEqual ( coverageReportMatches ?. length , 1 ) ;
478+ assert . strictEqual ( child . stderr . toString ( ) , '' ) ;
479+ }
480+ }
0 commit comments