@@ -342,7 +342,11 @@ describe('glob - withFileTypes', function() { |
342 | 342 | const promisified = promisify(glob); |
343 | 343 | for (const [pattern, expected] of Object.entries(patterns)) { |
344 | 344 | 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 | + }); |
346 | 350 | assertDirents(actual); |
347 | 351 | const normalized = expected.filter(Boolean).map((item) => basename(item)).sort(); |
348 | 352 | assert.deepStrictEqual(actual.map((dirent) => dirent.name).sort(), normalized.sort()); |
@@ -353,7 +357,11 @@ describe('glob - withFileTypes', function() { |
353 | 357 | describe('globSync - withFileTypes', function() { |
354 | 358 | for (const [pattern, expected] of Object.entries(patterns)) { |
355 | 359 | 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 | + }); |
357 | 365 | assertDirents(actual); |
358 | 366 | const normalized = expected.filter(Boolean).map((item) => basename(item)).sort(); |
359 | 367 | assert.deepStrictEqual(actual.map((dirent) => dirent.name).sort(), normalized.sort()); |
@@ -365,7 +373,11 @@ describe('fsPromises glob - withFileTypes', function() { |
365 | 373 | for (const [pattern, expected] of Object.entries(patterns)) { |
366 | 374 | test(pattern, async () => { |
367 | 375 | 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); |
369 | 381 | assertDirents(actual); |
370 | 382 | const normalized = expected.filter(Boolean).map((item) => basename(item)).sort(); |
371 | 383 | assert.deepStrictEqual(actual.map((dirent) => dirent.name).sort(), normalized.sort()); |
|