mirror of
https://github.com/stack-auth/stack.git
synced 2026-06-30 21:01:54 +08:00
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:
parent
75e497f3ec
commit
4a1787ee66
@ -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();
|
||||
});
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user