chore: Fix types in tests 41/N.

This commit is contained in:
cpojer
2026-02-17 15:48:16 +09:00
parent 3dc8d5656d
commit 6264c5e842
17 changed files with 81 additions and 43 deletions

View File

@@ -366,7 +366,7 @@ describe("applyAuthChoice", () => {
if (previousIsTTYDescriptor) {
Object.defineProperty(stdin, "isTTY", previousIsTTYDescriptor);
} else if (!hadOwnIsTTY) {
delete stdin.isTTY;
delete (stdin as { isTTY?: boolean }).isTTY;
}
}
});
@@ -653,7 +653,8 @@ describe("applyAuthChoice", () => {
const runtime = createExitThrowingRuntime();
const text: WizardPrompter["text"] = vi.fn(async (params) => {
if (params.message === "Paste the redirect URL") {
const lastLog = runtime.log.mock.calls.at(-1)?.[0];
const runtimeLog = runtime.log as ReturnType<typeof vi.fn>;
const lastLog = runtimeLog.mock.calls.at(-1)?.[0];
const urlLine = typeof lastLog === "string" ? lastLog : String(lastLog ?? "");
const urlMatch = urlLine.match(/https?:\/\/\S+/)?.[0] ?? "";
const state = urlMatch ? new URL(urlMatch).searchParams.get("state") : null;
@@ -734,7 +735,7 @@ describe("applyAuthChoice", () => {
},
],
},
]);
] as never);
const prompter = createPrompter({});
const runtime = createExitThrowingRuntime();
@@ -806,7 +807,7 @@ describe("applyAuthChoice", () => {
},
],
},
]);
] as never);
const prompter = createPrompter({
select: vi.fn(async () => "oauth" as never) as WizardPrompter["select"],