@@ -551,8 +551,8 @@ const followSymlinkExpectedWithFollow = [
551551 'follow/link/file.txt' . replaceAll ( '/' , sep ) ,
552552] . sort ( ) ;
553553
554- const assertNoNestedCycleMatches = ( matches ) => {
555- assert . ok ( ! matches . some ( ( match ) => match . startsWith ( `follow${ sep } cycle${ sep } ` ) ) , matches . join ( '\n' ) ) ;
554+ const getNestedCycleMatches = ( matches ) => {
555+ return matches . filter ( ( match ) => match . startsWith ( `follow${ sep } cycle${ sep } ` ) ) ;
556556} ;
557557
558558describe ( 'glob - followSymlinks' , function ( ) {
@@ -569,7 +569,7 @@ describe('glob - followSymlinks', function() {
569569 followSymlinks : true ,
570570 } ) ) . sort ( ) ;
571571 assert . deepStrictEqual ( actual , followSymlinkExpectedWithFollow ) ;
572- assertNoNestedCycleMatches ( actual ) ;
572+ assert . deepStrictEqual ( getNestedCycleMatches ( actual ) , [ ] ) ;
573573 } ) ;
574574} ) ;
575575
@@ -596,7 +596,7 @@ describe('globSync - followSymlinks', function() {
596596 followSymlinks : true ,
597597 } ) . sort ( ) ;
598598 assert . deepStrictEqual ( actual , followSymlinkExpectedWithFollow ) ;
599- assertNoNestedCycleMatches ( actual ) ;
599+ assert . deepStrictEqual ( getNestedCycleMatches ( actual ) , [ ] ) ;
600600 } ) ;
601601
602602 test ( 'supports withFileTypes when following symlinked directories' , ( ) => {
@@ -608,7 +608,7 @@ describe('globSync - followSymlinks', function() {
608608 assertDirents ( actual ) ;
609609 const normalized = actual . map ( normalizeDirent ) . sort ( ) ;
610610 assert . deepStrictEqual ( normalized , followSymlinkExpectedWithFollow ) ;
611- assertNoNestedCycleMatches ( normalized ) ;
611+ assert . deepStrictEqual ( getNestedCycleMatches ( normalized ) , [ ] ) ;
612612 } ) ;
613613} ) ;
614614
@@ -628,7 +628,7 @@ describe('fsPromises glob - followSymlinks', function() {
628628 } ) ) actual . push ( item ) ;
629629 actual . sort ( ) ;
630630 assert . deepStrictEqual ( actual , followSymlinkExpectedWithFollow ) ;
631- assertNoNestedCycleMatches ( actual ) ;
631+ assert . deepStrictEqual ( getNestedCycleMatches ( actual ) , [ ] ) ;
632632 } ) ;
633633} ) ;
634634
0 commit comments