diff options
| author | Anas H. Sulaiman <[email protected]> | 2025-06-13 14:26:31 -0400 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-13 14:26:31 -0400 |
| commit | 084b58a50edeaccc2261983fce2988e210637a0f (patch) | |
| tree | 652a2b722f57f94357c6597ce24f48149ca9a601 /packages/core/src/utils/getFolderStructure.test.ts | |
| parent | 1f63f3331f1d19e2157d87e8316828dc1c4c8b6b (diff) | |
reuse filtering service in getFolderStructure (#1016)
Diffstat (limited to 'packages/core/src/utils/getFolderStructure.test.ts')
| -rw-r--r-- | packages/core/src/utils/getFolderStructure.test.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/core/src/utils/getFolderStructure.test.ts b/packages/core/src/utils/getFolderStructure.test.ts index b3e5b723..843bf493 100644 --- a/packages/core/src/utils/getFolderStructure.test.ts +++ b/packages/core/src/utils/getFolderStructure.test.ts @@ -11,6 +11,7 @@ import { Dirent as FSDirent } from 'fs'; import * as nodePath from 'path'; import { getFolderStructure } from './getFolderStructure.js'; import * as gitUtils from './gitUtils.js'; +import { FileDiscoveryService } from '../services/fileDiscoveryService.js'; vi.mock('path', async (importOriginal) => { const original = (await importOriginal()) as typeof nodePath; @@ -319,8 +320,10 @@ describe('getFolderStructure gitignore', () => { }); it('should ignore files and folders specified in .gitignore', async () => { + const fileService = new FileDiscoveryService('/test/project'); + await fileService.initialize(); const structure = await getFolderStructure('/test/project', { - projectRoot: '/test/project', + fileService, }); expect(structure).not.toContain('ignored.txt'); expect(structure).toContain('node_modules/...'); @@ -328,9 +331,10 @@ describe('getFolderStructure gitignore', () => { }); it('should not ignore files if respectGitIgnore is false', async () => { + const fileService = new FileDiscoveryService('/test/project'); + await fileService.initialize({ respectGitIgnore: false }); const structure = await getFolderStructure('/test/project', { - projectRoot: '/test/project', - respectGitIgnore: false, + fileService, }); expect(structure).toContain('ignored.txt'); // node_modules is still ignored by default |
