initialize FileDiscoveryService once (#1029)

This commit is contained in:
Anas H. Sulaiman 2025-06-13 20:25:59 -04:00 committed by GitHub
parent 209381f06f
commit 8eb505fbba
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 42 additions and 12 deletions

View file

@ -33,11 +33,12 @@ vi.mock('@gemini-cli/core', async () => {
return {
...actualServer,
loadEnvironment: vi.fn(),
loadServerHierarchicalMemory: vi.fn((cwd, debug, extensionPaths) =>
Promise.resolve({
memoryContent: extensionPaths?.join(',') || '',
fileCount: extensionPaths?.length || 0,
}),
loadServerHierarchicalMemory: vi.fn(
(cwd, debug, fileService, extensionPaths) =>
Promise.resolve({
memoryContent: extensionPaths?.join(',') || '',
fileCount: extensionPaths?.length || 0,
}),
),
};
});
@ -239,6 +240,7 @@ describe('Hierarchical Memory Loading (config.ts) - Placeholder Suite', () => {
expect(ServerConfig.loadServerHierarchicalMemory).toHaveBeenCalledWith(
expect.any(String),
false,
expect.any(Object),
[
'/path/to/ext1/GEMINI.md',
'/path/to/ext3/context1.md',