You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gpt-pilot/test/helpers/wizard-prompter.ts

18 lines
604 B
TypeScript

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,
};
}