@@ -342,7 +342,11 @@ 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 , {
346+ cwd : fixtureDir ,
347+ withFileTypes : true ,
348+ exclude : ( dirent ) => assert . ok ( dirent instanceof Dirent ) ,
349+ } ) ;
346350 assertDirents ( actual ) ;
347351 const normalized = expected . filter ( Boolean ) . map ( ( item ) => basename ( item ) ) . sort ( ) ;
348352 assert . deepStrictEqual ( actual . map ( ( dirent ) => dirent . name ) . sort ( ) , normalized . sort ( ) ) ;
@@ -353,7 +357,11 @@ describe('glob - withFileTypes', function() {
353357describe ( 'globSync - withFileTypes' , function ( ) {
354358 for ( const [ pattern , expected ] of Object . entries ( patterns ) ) {
355359 test ( pattern , ( ) => {
356- const actual = globSync ( pattern , { cwd : fixtureDir , withFileTypes : true } ) ;
360+ const actual = globSync ( pattern , {
361+ cwd : fixtureDir ,
362+ withFileTypes : true ,
363+ exclude : ( dirent ) => assert . ok ( dirent instanceof Dirent ) ,
364+ } ) ;
357365 assertDirents ( actual ) ;
358366 const normalized = expected . filter ( Boolean ) . map ( ( item ) => basename ( item ) ) . sort ( ) ;
359367 assert . deepStrictEqual ( actual . map ( ( dirent ) => dirent . name ) . sort ( ) , normalized . sort ( ) ) ;
@@ -365,7 +373,11 @@ describe('fsPromises glob - withFileTypes', function() {
365373 for ( const [ pattern , expected ] of Object . entries ( patterns ) ) {
366374 test ( pattern , async ( ) => {
367375 const actual = [ ] ;
368- for await ( const item of asyncGlob ( pattern , { cwd : fixtureDir , withFileTypes : true } ) ) actual . push ( item ) ;
376+ for await ( const item of asyncGlob ( pattern , {
377+ cwd : fixtureDir ,
378+ withFileTypes : true ,
379+ exclude : ( dirent ) => assert . ok ( dirent instanceof Dirent ) ,
380+ } ) ) actual . push ( item ) ;
369381 assertDirents ( actual ) ;
370382 const normalized = expected . filter ( Boolean ) . map ( ( item ) => basename ( item ) ) . sort ( ) ;
371383 assert . deepStrictEqual ( actual . map ( ( dirent ) => dirent . name ) . sort ( ) , normalized . sort ( ) ) ;
0 commit comments