(
toolRegistryMocks = {},
)
| 39 | vi.mock('../ide/ide-client.js'); |
| 40 | |
| 41 | async function createMockConfig( |
| 42 | toolRegistryMocks = {}, |
| 43 | ): Promise<{ config: Config; toolRegistry: ToolRegistry }> { |
| 44 | const configParams: ConfigParameters = { |
| 45 | sessionId: 'test-session', |
| 46 | model: DEFAULT_PRIMARY_MODEL, |
| 47 | targetDir: '.', |
| 48 | debugMode: false, |
| 49 | cwd: process.cwd(), |
| 50 | }; |
| 51 | const config = new Config(configParams); |
| 52 | await config.initialize(); |
| 53 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 54 | await config.refreshAuth('test-auth' as any); |
| 55 | |
| 56 | // Mock ToolRegistry |
| 57 | const mockToolRegistry = { |
| 58 | getTool: vi.fn(), |
| 59 | getFunctionDeclarationsFiltered: vi.fn().mockReturnValue([]), |
| 60 | ...toolRegistryMocks, |
| 61 | } as unknown as ToolRegistry; |
| 62 | |
| 63 | vi.spyOn(config, 'getToolRegistry').mockResolvedValue(mockToolRegistry); |
| 64 | return { config, toolRegistry: mockToolRegistry }; |
| 65 | } |
| 66 | |
| 67 | // Helper to simulate LLM responses (sequence of tool calls over multiple turns) |
| 68 | const createMockStream = ( |
no test coverage detected