mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 00:58:28 +00:00
chore: Fix types in tests 41/N.
This commit is contained in:
@@ -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"],
|
||||
|
||||
Reference in New Issue
Block a user