MCPcopy Create free account
hub / github.com/MicrosoftDocs/mcp / createTestContext

Function createTestContext

cli/test/unit/cli.test.ts:22–45  ·  view source on GitHub ↗
(client: LearnCliClientLike)

Source from the content-addressed store, hash-verified

20 }),
21 close: vi.fn<LearnCliClientLike['close']>().mockResolvedValue(undefined),
22 ...overrides,
23 };
24}
25
26function createTestContext(client: LearnCliClientLike): {
27 context: Partial<CliContext>;
28 stdout: string[];
29 stderr: string[];
30} {
31 const stdout: string[] = [];
32 const stderr: string[] = [];
33
34 return {
35 context: {
36 env: {},
37 version: '0.1.0-test',
38 writeOut: (value) => {
39 stdout.push(value);
40 },
41 writeErr: (value) => {
42 stderr.push(value);
43 },
44 createClient: () => client,
45 },
46 stdout,
47 stderr,
48 };

Callers 1

cli.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected