Skip to content

Commit 6239d0f

Browse files
committed
Fix readDirNames test for ignored files with includeEmpty
Directories containing only ignored files should be excluded when includeEmpty is false
1 parent 4aa4857 commit 6239d0f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/registry/fs.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -444,13 +444,13 @@ describe('fs', () => {
444444
await fs.mkdir(nonEmptyDir)
445445
await fs.writeFile(path.join(nonEmptyDir, 'file.txt'), '', 'utf8')
446446

447-
// With ignore patterns, the empty-dir should be included because .git is ignored
447+
// With ignore patterns and includeEmpty: false, directories containing only ignored files are excluded
448448
const result = await readDirNames(tmpDir, {
449449
ignore: ['.git'],
450450
includeEmpty: false,
451451
})
452452
expect(result).toContain('non-empty-dir')
453-
expect(result).toContain('empty-dir')
453+
expect(result).not.toContain('empty-dir')
454454
}, 'readDirNames-ignore-')
455455
})
456456
})

0 commit comments

Comments
 (0)