chore: Fix types in tests 21/N.

This commit is contained in:
cpojer
2026-02-17 12:22:17 +09:00
parent 18cc48dfd9
commit 245018fd6b
6 changed files with 48 additions and 20 deletions

View File

@@ -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"],
});

View File

@@ -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", () => ({