mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 15:41:23 +00:00
chore: Fix types in tests 21/N.
This commit is contained in:
@@ -62,7 +62,7 @@ describe("setupChannels", () => {
|
||||
});
|
||||
|
||||
const prompter = createPrompter({
|
||||
select,
|
||||
select: select as unknown as WizardPrompter["select"],
|
||||
multiselect,
|
||||
text: text as unknown as WizardPrompter["text"],
|
||||
});
|
||||
@@ -82,13 +82,13 @@ describe("setupChannels", () => {
|
||||
});
|
||||
|
||||
it("shows explicit dmScope config command in channel primer", async () => {
|
||||
const note = vi.fn(async () => {});
|
||||
const note = vi.fn(async (_message?: string, _title?: string) => {});
|
||||
const select = vi.fn(async () => "__done__");
|
||||
const { multiselect, text } = createUnexpectedPromptGuards();
|
||||
|
||||
const prompter = createPrompter({
|
||||
note,
|
||||
select,
|
||||
select: select as unknown as WizardPrompter["select"],
|
||||
multiselect,
|
||||
text,
|
||||
});
|
||||
@@ -121,7 +121,7 @@ describe("setupChannels", () => {
|
||||
const { multiselect, text } = createUnexpectedPromptGuards();
|
||||
|
||||
const prompter = createPrompter({
|
||||
select,
|
||||
select: select as unknown as WizardPrompter["select"],
|
||||
multiselect,
|
||||
text,
|
||||
});
|
||||
@@ -173,7 +173,7 @@ describe("setupChannels", () => {
|
||||
throw new Error("unexpected multiselect");
|
||||
});
|
||||
const prompter = createPrompter({
|
||||
select,
|
||||
select: select as unknown as WizardPrompter["select"],
|
||||
multiselect,
|
||||
text: vi.fn(async () => "") as unknown as WizardPrompter["text"],
|
||||
});
|
||||
|
||||
@@ -8,14 +8,19 @@ import {
|
||||
} from "./onboard-helpers.js";
|
||||
|
||||
const mocks = vi.hoisted(() => ({
|
||||
runCommandWithTimeout: vi.fn(async () => ({
|
||||
runCommandWithTimeout: vi.fn<
|
||||
(
|
||||
argv: string[],
|
||||
options?: { timeoutMs?: number; windowsVerbatimArguments?: boolean },
|
||||
) => Promise<{ stdout: string; stderr: string; code: number; signal: null; killed: boolean }>
|
||||
>(async () => ({
|
||||
stdout: "",
|
||||
stderr: "",
|
||||
code: 0,
|
||||
signal: null,
|
||||
killed: false,
|
||||
})),
|
||||
pickPrimaryTailnetIPv4: vi.fn(() => undefined),
|
||||
pickPrimaryTailnetIPv4: vi.fn<() => string | undefined>(() => undefined),
|
||||
}));
|
||||
|
||||
vi.mock("../process/exec.js", () => ({
|
||||
|
||||
Reference in New Issue
Block a user