fix(ci): restore main green

This commit is contained in:
Tak Hoffman
2026-03-25 16:17:42 -05:00
parent 501190d2e8
commit 79fbcfc03b
7 changed files with 21 additions and 19 deletions

View File

@@ -26,7 +26,7 @@ describe("listMicrosoftVoices", () => {
]),
{ status: 200 },
),
) as typeof globalThis.fetch;
) as unknown as typeof globalThis.fetch;
const voices = await listMicrosoftVoices();
@@ -56,7 +56,9 @@ describe("listMicrosoftVoices", () => {
it("throws on Microsoft voice list failures", async () => {
globalThis.fetch = vi
.fn()
.mockResolvedValue(new Response("nope", { status: 503 })) as typeof globalThis.fetch;
.mockResolvedValue(
new Response("nope", { status: 503 }),
) as unknown as typeof globalThis.fetch;
await expect(listMicrosoftVoices()).rejects.toThrow("Microsoft voices API error (503)");
});

View File

@@ -60,7 +60,7 @@ describe("msteams graph helpers", () => {
status: 200,
headers: { "content-type": "application/json" },
});
}) as typeof fetch;
}) as unknown as typeof fetch;
await expect(
fetchGraphJson<{ value: Array<{ id: string }> }>({
@@ -82,7 +82,7 @@ describe("msteams graph helpers", () => {
globalThis.fetch = vi.fn(async () => {
return new Response("forbidden", { status: 403 });
}) as typeof fetch;
}) as unknown as typeof fetch;
await expect(
fetchGraphJson({
@@ -148,7 +148,7 @@ describe("msteams graph helpers", () => {
headers: { "content-type": "application/json" },
},
);
}) as typeof fetch;
}) as unknown as typeof fetch;
await expect(listTeamsByName("graph-token", "Bob's Team")).resolves.toEqual([
{ id: "team-1", displayName: "Ops" },
@@ -165,7 +165,7 @@ describe("msteams graph helpers", () => {
});
it("returns no graph users for blank queries", async () => {
globalThis.fetch = vi.fn() as typeof fetch;
globalThis.fetch = vi.fn() as unknown as typeof fetch;
await expect(searchGraphUsers({ token: "token-1", query: " " })).resolves.toEqual([]);
expect(globalThis.fetch).not.toHaveBeenCalled();
});
@@ -176,7 +176,7 @@ describe("msteams graph helpers", () => {
status: 200,
headers: { "content-type": "application/json" },
});
}) as typeof fetch;
}) as unknown as typeof fetch;
const result = await searchGraphUsers({
token: "token-2",
@@ -202,7 +202,7 @@ describe("msteams graph helpers", () => {
status: 200,
headers: { "content-type": "application/json" },
});
}) as typeof fetch;
}) as unknown as typeof fetch;
await expect(searchGraphUsers({ token: "token-3", query: "bob", top: 25 })).resolves.toEqual([
{ id: "user-2", displayName: "Bob" },

View File

@@ -11,7 +11,7 @@ describe("twilioApiRequest", () => {
it("posts form bodies with basic auth and parses json", async () => {
globalThis.fetch = vi.fn(async () => {
return new Response(JSON.stringify({ sid: "CA123" }), { status: 200 });
}) as typeof fetch;
}) as unknown as typeof fetch;
await expect(
twilioApiRequest({
@@ -47,7 +47,7 @@ describe("twilioApiRequest", () => {
new Response(null, { status: 204 }),
new Response("missing", { status: 404 }),
];
globalThis.fetch = vi.fn(async () => responses.shift()!) as typeof fetch;
globalThis.fetch = vi.fn(async () => responses.shift()!) as unknown as typeof fetch;
await expect(
twilioApiRequest({
@@ -74,7 +74,7 @@ describe("twilioApiRequest", () => {
it("throws twilio api errors for non-ok responses", async () => {
globalThis.fetch = vi.fn(
async () => new Response("bad request", { status: 400 }),
) as typeof fetch;
) as unknown as typeof fetch;
await expect(
twilioApiRequest({