test(wizard): share onboarding prompter scaffold

This commit is contained in:
Peter Steinberger
2026-02-21 22:27:25 +00:00
parent 3d718b5c37
commit 07d09c881d
3 changed files with 25 additions and 29 deletions

View File

@@ -0,0 +1,17 @@
import { vi } from "vitest";
import type { WizardPrompter } from "../../src/wizard/prompts.js";
export function createWizardPrompter(overrides?: Partial<WizardPrompter>): WizardPrompter {
const select = vi.fn(async () => "quickstart") as unknown as WizardPrompter["select"];
return {
intro: vi.fn(async () => {}),
outro: vi.fn(async () => {}),
note: vi.fn(async () => {}),
select,
multiselect: vi.fn(async () => []),
text: vi.fn(async () => ""),
confirm: vi.fn(async () => false),
progress: vi.fn(() => ({ update: vi.fn(), stop: vi.fn() })),
...overrides,
};
}