MCPcopy Index your code
hub / github.com/github/copilot-sdk / setupClient

Function setupClient

nodejs/test/toolSet.test.ts:119–138  ·  view source on GitHub ↗
(mode?: "empty" | "copilot-cli")

Source from the content-addressed store, hash-verified

117
118describe("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();

Callers 1

toolSet.test.tsFile · 0.85

Calls 2

startMethod · 0.95
forceStopMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…