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

Function makeClack

src/shell/ui/clack/styledClack.mock.ts:18–58  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16};
17
18export function makeClack() {
19 const isCancel = mock<(value: unknown) => boolean>();
20 const createdSpinners: MockSpinner[] = [];
21 const createdTaskLogs: MockTaskLog[] = [];
22 const clack = {
23 log: {
24 info: mock(),
25 error: mock(),
26 step: mock(),
27 success: mock(),
28 warn: mock(),
29 },
30 intro: mock(),
31 note: mock(),
32 outro: mock(),
33 cancel: mock(),
34 confirm: mock(),
35 password: mock(),
36 isCancel: isCancel as typeof isCancel & StyledClack["isCancel"],
37 spinner: mock((): MockSpinner => {
38 const s: MockSpinner = {
39 start: mock(),
40 message: mock(),
41 stop: mock(),
42 error: mock(),
43 };
44 createdSpinners.push(s);
45 return s;
46 }),
47 taskLog: mock((_opts: { title: string; limit?: number }) => {
48 const tl: MockTaskLog = {
49 message: mock(),
50 success: mock(),
51 error: mock(),
52 };
53 createdTaskLogs.push(tl);
54 return tl;
55 }),
56 } satisfies StyledClack;
57 return { ...clack, createdSpinners, createdTaskLogs };
58}

Callers 6

password.test.tsFile · 0.85
confirm.test.tsFile · 0.85
human.test.tsFile · 0.85
json.test.tsFile · 0.85
agent.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected