()
| 16 | }; |
| 17 | |
| 18 | export 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 | } |
no outgoing calls
no test coverage detected