Ein Client, der genau die vorbereiteten Antworten gibt und alles mitschreibt.
(pages: unknown[], status: unknown = STATUS)
| 58 | |
| 59 | /** Ein Client, der genau die vorbereiteten Antworten gibt und alles mitschreibt. */ |
| 60 | function fakeClient(pages: unknown[], status: unknown = STATUS) { |
| 61 | const calls: Record<string, unknown>[] = []; |
| 62 | let index = 0; |
| 63 | const client = { |
| 64 | indexStatusPayload: vi.fn(async () => { |
| 65 | calls.push({ tool: 'index_status' }); |
| 66 | return status; |
| 67 | }), |
| 68 | checkIndexCoverage: vi.fn(async (_project: string, args: Record<string, unknown>) => { |
| 69 | calls.push({ tool: 'check_index_coverage', ...args }); |
| 70 | const answer = pages[Math.min(index, pages.length - 1)]; |
| 71 | index += 1; |
| 72 | return answer; |
| 73 | }), |
| 74 | } as unknown as RpcIntelligenceClient; |
| 75 | return { client, calls }; |
| 76 | } |
| 77 | |
| 78 | describe('loadCoverage', () => { |
| 79 |
no test coverage detected