MCPcopy
hub / github.com/qawolf/cli / makeFakeUI

Function makeFakeUI

src/shell/commandContext.testUtils.ts:12–40  ·  view source on GitHub ↗
(mode: OutputMode = "human")

Source from the content-addressed store, hash-verified

10const noopSignals = makeNoopSignals();
11
12export function makeFakeUI(mode: OutputMode = "human"): UI {
13 return {
14 mode,
15 gap: mock(() => {}),
16 intro: mock(() => {}),
17 note: mock(() => {}),
18 outro: mock(() => {}),
19 confirm: mock(() => Promise.resolve({ ok: false } as const)),
20 password: mock(() => Promise.resolve({ ok: false } as const)),
21 withProgress: mock(
22 async (steps: { message: string; task: () => Promise<unknown> }[]) => {
23 const results: unknown[] = [];
24 for (const step of steps) {
25 results.push(await step.task());
26 }
27 return results;
28 },
29 ) as unknown as UI["withProgress"],
30 step: mock(() => {}),
31 success: mock(() => {}),
32 warn: mock(() => {}),
33 cancel: mock(() => {}),
34 json: mock(() => {}),
35 output: mock(() => {}),
36 error: mock(() => {}),
37 info: mock(() => {}),
38 write: mock(() => {}),
39 };
40}
41
42export function makeCtx(
43 mode: OutputMode = "human",

Callers 14

makeCtxFunction · 0.85
makeCtxFunction · 0.85
makeCtxFunction · 0.85
makeCtxFunction · 0.85
makeCtxFunction · 0.85
handle.test.tsFile · 0.85
makeCtxFunction · 0.85
list.json.test.tsFile · 0.85
listRemote.test.tsFile · 0.85
makeAgentCtxFunction · 0.85
list.agent.test.tsFile · 0.85
makeCtxFunction · 0.85

Calls

no outgoing calls

Tested by 8

makeCtxFunction · 0.68
makeCtxFunction · 0.68
makeCtxFunction · 0.68
makeCtxFunction · 0.68
makeCtxFunction · 0.68
makeAgentCtxFunction · 0.68
makeCtxFunction · 0.68
makeJsonUiFunction · 0.68