@@ -206,7 +206,7 @@ describe('require(\'node:test\').run', { concurrency: true }, () => {
206206 files : [ join ( testFixtures , 'default-behavior/test/random.cjs' ) ] ,
207207 watch : true ,
208208 signal : controller . signal ,
209- } ) . on ( 'data' , function ( { type } ) {
209+ } ) . on ( 'data' , function ( { type } ) {
210210 if ( type === 'test:watch:drained' ) {
211211 controller . abort ( ) ;
212212 }
@@ -650,6 +650,48 @@ describe('require(\'node:test\').run', { concurrency: true }, () => {
650650 } ) ;
651651} ) ;
652652
653+ describe ( "with isolation set to 'none'" , ( ) => {
654+ it ( 'should skip tests not matching testNamePatterns - string' , async ( ) => {
655+ const result = await run ( {
656+ files : [ join ( testFixtures , 'default-behavior/test/skip_by_name.cjs' ) ] ,
657+ testNamePatterns : [ 'executed' ] ,
658+ isolation : 'none' ,
659+ } )
660+ . compose ( tap )
661+ . toArray ( ) ;
662+ assert . strictEqual ( result [ 2 ] , 'ok 1 - this should be executed\n' ) ;
663+ assert . strictEqual ( result [ 4 ] , '1..1\n' ) ;
664+ assert . strictEqual ( result [ 5 ] , '# tests 1\n' ) ;
665+ } ) ;
666+
667+ it ( 'should skip tests not matching testNamePatterns - RegExp' , async ( ) => {
668+ const result = await run ( {
669+ files : [ join ( testFixtures , 'default-behavior/test/skip_by_name.cjs' ) ] ,
670+ testNamePatterns : [ / e x e c u t e d / ] ,
671+ isolation : 'none' ,
672+ } )
673+ . compose ( tap )
674+ . toArray ( ) ;
675+ assert . strictEqual ( result [ 2 ] , 'ok 1 - this should be executed\n' ) ;
676+ assert . strictEqual ( result [ 4 ] , '1..1\n' ) ;
677+ assert . strictEqual ( result [ 5 ] , '# tests 1\n' ) ;
678+ } ) ;
679+
680+ it ( 'should skip tests matching testSkipPatterns' , async ( ) => {
681+ const result = await run ( {
682+ files : [ join ( testFixtures , 'default-behavior/test/skip_by_name.cjs' ) ] ,
683+ testSkipPatterns : [ 'skipped' ] ,
684+ isolation : 'none' ,
685+ } )
686+ . compose ( tap )
687+ . toArray ( ) ;
688+
689+ assert . strictEqual ( result [ 2 ] , 'ok 1 - this should be executed\n' ) ;
690+ assert . strictEqual ( result [ 4 ] , '1..1\n' ) ;
691+ assert . strictEqual ( result [ 5 ] , '# tests 1\n' ) ;
692+ } ) ;
693+ } ) ;
694+
653695describe ( 'forceExit' , ( ) => {
654696 it ( 'throws for non-boolean values' , ( ) => {
655697 [ Symbol ( ) , { } , 0 , 1 , '1' , Promise . resolve ( [ ] ) ] . forEach ( ( forceExit ) => {
@@ -668,7 +710,6 @@ describe('forceExit', () => {
668710 } ) ;
669711} ) ;
670712
671-
672713// exitHandler doesn't run until after the tests / after hooks finish.
673714process . on ( 'exit' , ( ) => {
674715 assert . strictEqual ( process . listeners ( 'uncaughtException' ) . length , 0 ) ;
0 commit comments