MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / invokeAndCapture

Function invokeAndCapture

e2e/scenarios/auth-methods.test.ts:372–384  ·  view source on GitHub ↗
(conn: string, marker: string)

Source from the content-addressed store, hash-verified

370 const session = mcp.session(identity);
371
372 const invokeAndCapture = (conn: string, marker: string) =>
373 Effect.gen(function* () {
374 const before = (yield* server.requests).length;
375 const result = yield* session.call("execute", {
376 // Return the whole result — the assertion only needs the echoed
377 // marker to prove the call reached the server.
378 code: `return JSON.stringify(await tools.${slug}.org.${conn}.whoami({ marker: ${JSON.stringify(marker)} }));`,
379 });
380 expect(result.text, `the ${conn} invocation reached the server`).toContain(
381 `ok:${marker}`,
382 );
383 return (yield* server.requests).slice(before);
384 });
385
386 const mixedRequests = yield* invokeAndCapture("mixed", "m1");
387 expect(

Callers 1

Calls 1

callMethod · 0.80

Tested by

no test coverage detected