(mode?: "empty" | "copilot-cli")
| 117 | |
| 118 | describe("Tool filter wiring", () => { |
| 119 | async function setupClient(mode?: "empty" | "copilot-cli") { |
| 120 | const client = new CopilotClient({ |
| 121 | mode, |
| 122 | baseDirectory: mode === "empty" ? "/tmp/copilot-test" : undefined, |
| 123 | }); |
| 124 | await client.start(); |
| 125 | onTestFinished(() => client.forceStop()); |
| 126 | const spy = vi |
| 127 | .spyOn((client as any).connection!, "sendRequest") |
| 128 | .mockImplementation(async (method: string, params: any) => { |
| 129 | if (method === "session.create" || method === "session.resume") { |
| 130 | return { sessionId: params.sessionId ?? "session-id" }; |
| 131 | } |
| 132 | if (method === "session.options.update") { |
| 133 | return { success: true }; |
| 134 | } |
| 135 | throw new Error(`Unexpected method: ${method}`); |
| 136 | }); |
| 137 | return { client, spy }; |
| 138 | } |
| 139 | |
| 140 | it("converts ToolSet to plain string[] on the wire", async () => { |
| 141 | const { client, spy } = await setupClient(); |
no test coverage detected
searching dependent graphs…