@@ -334,3 +334,27 @@ const testFixtures = fixtures.path('test-runner');
334
334
assert . match ( stdout , / # f a i l 0 / ) ;
335
335
assert . match ( stdout , / # s k i p p e d 0 / ) ;
336
336
}
337
+
338
+ {
339
+ // --require should only be applied to individual test processes, not the orchestrator
340
+ const args = [ '--test' , '--require' , join ( testFixtures , 'print_pid.js' ) , join ( testFixtures , 'index.js' ) ] ;
341
+ const child = spawnSync ( process . execPath , args , { cwd : testFixtures } ) ;
342
+
343
+ assert . strictEqual ( child . status , 1 ) ;
344
+ assert . strictEqual ( child . signal , null ) ;
345
+ assert . strictEqual ( child . stderr . toString ( ) , '' ) ;
346
+ assert . match ( child . stdout . toString ( ) , / p i d : \d + / ) ;
347
+ assert . doesNotMatch ( child . stdout . toString ( ) , new RegExp ( `pid: ${ child . pid } ` ) ) ;
348
+ }
349
+
350
+ {
351
+ // --import should only be applied to individual test processes, not the orchestrator
352
+ const args = [ '--test' , '--require' , join ( testFixtures , 'print_pid.js' ) , join ( testFixtures , 'index.js' ) ] ;
353
+ const child = spawnSync ( process . execPath , args , { cwd : testFixtures } ) ;
354
+
355
+ assert . strictEqual ( child . status , 1 ) ;
356
+ assert . strictEqual ( child . signal , null ) ;
357
+ assert . strictEqual ( child . stderr . toString ( ) , '' ) ;
358
+ assert . match ( child . stdout . toString ( ) , / p i d : \d + / ) ;
359
+ assert . doesNotMatch ( child . stdout . toString ( ) , new RegExp ( `pid: ${ child . pid } ` ) ) ;
360
+ }
0 commit comments