@@ -6,12 +6,10 @@ import type { RuntimeEnv } from "../../src/runtime.js";
|
6 | 6 | import { makeTempWorkspace } from "../../src/test-helpers/workspace.js"; |
7 | 7 | import { captureEnv } from "../../src/test-utils/env.js"; |
8 | 8 | import type { WizardPrompter } from "../../src/wizard/prompts.js"; |
| 9 | +import { createWizardPrompter as createBaseWizardPrompter } from "./wizard-prompter.js"; |
9 | 10 | |
10 | 11 | // Shared auth wizard test helpers for runtime/env setup. |
11 | 12 | |
12 | | -const noopAsync = async () => {}; |
13 | | -const noop = () => {}; |
14 | | - |
15 | 13 | /** Create a RuntimeEnv whose exit method throws for assertions. */ |
16 | 14 | export function createExitThrowingRuntime(): RuntimeEnv { |
17 | 15 | return { |
@@ -28,17 +26,7 @@ export function createWizardPrompter(
|
28 | 26 | overrides: Partial<WizardPrompter>, |
29 | 27 | options?: { defaultSelect?: string }, |
30 | 28 | ): WizardPrompter { |
31 | | -return { |
32 | | -intro: vi.fn(noopAsync), |
33 | | -outro: vi.fn(noopAsync), |
34 | | -note: vi.fn(noopAsync), |
35 | | -select: vi.fn(async () => (options?.defaultSelect ?? "") as never), |
36 | | -multiselect: vi.fn(async () => []), |
37 | | -text: vi.fn(async () => "") as unknown as WizardPrompter["text"], |
38 | | -confirm: vi.fn(async () => false), |
39 | | -progress: vi.fn(() => ({ update: noop, stop: noop })), |
40 | | - ...overrides, |
41 | | -}; |
| 29 | +return createBaseWizardPrompter(overrides, { defaultSelect: options?.defaultSelect ?? "" }); |
42 | 30 | } |
43 | 31 | |
44 | 32 | /** Create isolated auth state and agent directories for auth tests. */ |
|