Fix typecheck in template cross-domain test

mockImplementation expects (...args: unknown[]) => unknown, so typing the
callback parameter directly as { url: string | URL } failed with TS2345.
Accept variadic unknown args and cast args[0] instead.
This commit is contained in:
mantrakp04 2026-06-18 17:52:45 -07:00
parent 75e497f3ec
commit 4a1787ee66

View File

@ -447,7 +447,8 @@ describe("StackClientApp cross-domain auth", () => {
}));
let currentHref = callbackUrl.toString();
let redirectedUrl = "";
const redirectSpy = vi.spyOn(StackClientApp.prototype as any, "_redirectTo").mockImplementation(async (options: { url: string | URL }) => {
const redirectSpy = vi.spyOn(StackClientApp.prototype as any, "_redirectTo").mockImplementation(async (...args: unknown[]) => {
const options = args[0] as { url: string | URL };
redirectedUrl = options.url.toString();
});