MCPcopy Create free account
hub / github.com/adcontextprotocol/adcp / makeClient

Function makeClient

server/tests/unit/batch.test.ts:14–29  ·  view source on GitHub ↗

* Tests for the batch processing utility. * * Mocks the Anthropic SDK batch methods since we're testing our * orchestration logic (submission, polling, result collection), * not the Anthropic API itself.

(overrides: {
  create?: ReturnType<typeof vi.fn>;
  retrieve?: ReturnType<typeof vi.fn>;
  results?: ReturnType<typeof vi.fn>;
} = {})

Source from the content-addressed store, hash-verified

12 */
13
14function makeClient(overrides: {
15 create?: ReturnType<typeof vi.fn>;
16 retrieve?: ReturnType<typeof vi.fn>;
17 results?: ReturnType<typeof vi.fn>;
18} = {}) {
19 return {
20 messages: {
21 batches: {
22 create: overrides.create ?? vi.fn(),
23 retrieve: overrides.retrieve ?? vi.fn(),
24 results: overrides.results ?? vi.fn(),
25 cancel: vi.fn(),
26 },
27 },
28 } as unknown as Anthropic;
29}
30
31function makeSucceededEntry(customId: string, text: string) {
32 return {

Callers 1

batch.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected