@@ -342,7 +342,7 @@ describe('glob - withFileTypes', function() {
342342 const promisified = promisify ( glob ) ;
343343 for ( const [ pattern , expected ] of Object . entries ( patterns ) ) {
344344 test ( pattern , async ( ) => {
345- const actual = await promisified ( pattern , { cwd : fixtureDir , withFileTypes : true } ) ;
345+ const actual = await promisified ( pattern , { cwd : fixtureDir , withFileTypes : true , exclude : ( dirent ) => assert . ok ( dirent instanceof Dirent ) } ) ;
346346 assertDirents ( actual ) ;
347347 const normalized = expected . filter ( Boolean ) . map ( ( item ) => basename ( item ) ) . sort ( ) ;
348348 assert . deepStrictEqual ( actual . map ( ( dirent ) => dirent . name ) . sort ( ) , normalized . sort ( ) ) ;
@@ -353,7 +353,7 @@ describe('glob - withFileTypes', function() {
353353describe ( 'globSync - withFileTypes' , function ( ) {
354354 for ( const [ pattern , expected ] of Object . entries ( patterns ) ) {
355355 test ( pattern , ( ) => {
356- const actual = globSync ( pattern , { cwd : fixtureDir , withFileTypes : true } ) ;
356+ const actual = globSync ( pattern , { cwd : fixtureDir , withFileTypes : true , exclude : ( dirent ) => assert . ok ( dirent instanceof Dirent ) } ) ;
357357 assertDirents ( actual ) ;
358358 const normalized = expected . filter ( Boolean ) . map ( ( item ) => basename ( item ) ) . sort ( ) ;
359359 assert . deepStrictEqual ( actual . map ( ( dirent ) => dirent . name ) . sort ( ) , normalized . sort ( ) ) ;
@@ -365,7 +365,7 @@ describe('fsPromises glob - withFileTypes', function() {
365365 for ( const [ pattern , expected ] of Object . entries ( patterns ) ) {
366366 test ( pattern , async ( ) => {
367367 const actual = [ ] ;
368- for await ( const item of asyncGlob ( pattern , { cwd : fixtureDir , withFileTypes : true } ) ) actual . push ( item ) ;
368+ for await ( const item of asyncGlob ( pattern , { cwd : fixtureDir , withFileTypes : true , exclude : ( dirent ) => assert . ok ( dirent instanceof Dirent ) } ) ) actual . push ( item ) ;
369369 assertDirents ( actual ) ;
370370 const normalized = expected . filter ( Boolean ) . map ( ( item ) => basename ( item ) ) . sort ( ) ;
371371 assert . deepStrictEqual ( actual . map ( ( dirent ) => dirent . name ) . sort ( ) , normalized . sort ( ) ) ;
0 commit comments