MCPcopy Create free account
hub / github.com/anus-dev/ANUS / createMockConfig

Function createMockConfig

packages/core/src/core/subagent.test.ts:41–65  ·  view source on GitHub ↗
(
  toolRegistryMocks = {},
)

Source from the content-addressed store, hash-verified

39vi.mock('../ide/ide-client.js');
40
41async 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)
68const createMockStream = (

Callers 1

subagent.test.tsFile · 0.85

Calls 2

initializeMethod · 0.95
refreshAuthMethod · 0.95

Tested by

no test coverage detected