mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 09:37:41 +00:00
feat: add onboarding plugin install flow
This commit is contained in:
25
src/commands/onboarding/__tests__/test-utils.ts
Normal file
25
src/commands/onboarding/__tests__/test-utils.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { vi } from "vitest";
|
||||
|
||||
import type { RuntimeEnv } from "../../../runtime.js";
|
||||
import type { WizardPrompter } from "../../../wizard/prompts.js";
|
||||
|
||||
export const makeRuntime = (overrides: Partial<RuntimeEnv> = {}): RuntimeEnv => ({
|
||||
log: vi.fn(),
|
||||
error: vi.fn(),
|
||||
exit: vi.fn(),
|
||||
...overrides,
|
||||
});
|
||||
|
||||
export const makePrompter = (
|
||||
overrides: Partial<WizardPrompter> = {},
|
||||
): WizardPrompter => ({
|
||||
intro: vi.fn(async () => {}),
|
||||
outro: vi.fn(async () => {}),
|
||||
note: vi.fn(async () => {}),
|
||||
select: vi.fn(async () => "npm") as WizardPrompter["select"],
|
||||
multiselect: vi.fn(async () => []) as WizardPrompter["multiselect"],
|
||||
text: vi.fn(async () => "") as WizardPrompter["text"],
|
||||
confirm: vi.fn(async () => false),
|
||||
progress: vi.fn(() => ({ update: vi.fn(), stop: vi.fn() })),
|
||||
...overrides,
|
||||
});
|
||||
Reference in New Issue
Block a user