test: fix msteams shared attachment fetch mock typing

This commit is contained in:
Peter Steinberger
2026-02-23 00:19:40 +00:00
parent 60c494c024
commit 0371646a61

View File

@@ -120,11 +120,13 @@ describe("resolveAndValidateIP", () => {
describe("safeFetch", () => {
it("fetches a URL directly when no redirect occurs", async () => {
const fetchMock = vi.fn<typeof fetch>(async () => new Response("ok", { status: 200 }));
const fetchMock = vi.fn(async (_url: string, _init?: RequestInit) => {
return new Response("ok", { status: 200 });
});
const res = await safeFetch({
url: "https://teams.sharepoint.com/file.pdf",
allowHosts: ["sharepoint.com"],
fetchFn: fetchMock,
fetchFn: fetchMock as unknown as typeof fetch,
resolveFn: publicResolve,
});
expect(res.status).toBe(200);