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({

View File

@@ -135,7 +135,7 @@ beforeEach(() => {
globalThis.fetch = vi.fn(async (input: string | URL | Request) => {
const url = typeof input === "string" ? input : input instanceof URL ? input.href : input.url;
throw new Error(`Unexpected fetch in test: ${url}`);
}) as typeof fetch;
}) as unknown as typeof fetch;
computeBackoffMock.mockClear();
sleepWithAbortMock.mockClear();
});

View File

@@ -159,7 +159,7 @@ export type ClawHubDownloadResult = {
integrity: string;
};
type FetchLike = typeof fetch;
type FetchLike = (input: string | URL | Request, init?: RequestInit) => Promise<Response>;
type ClawHubRequestParams = {
baseUrl?: string;

View File

@@ -1,7 +1,7 @@
import type { Component } from "@mariozechner/pi-tui";
import {
Input,
getEditorKeybindings,
getKeybindings,
matchesKey,
type SelectItem,
SelectList,
@@ -110,8 +110,8 @@ export class FilterableSelectList implements Component {
}
// Escape: clear filter or cancel
const kb = getEditorKeybindings();
if (kb.matches(keyData, "selectCancel")) {
const kb = getKeybindings();
if (kb.matches(keyData, "tui.select.cancel")) {
if (this.filterText) {
this.filterText = "";
this.input.setValue("");

View File

@@ -1,6 +1,6 @@
import {
type Component,
getEditorKeybindings,
getKeybindings,
Input,
isKeyRelease,
matchesKey,
@@ -362,8 +362,8 @@ export class SearchableSelectList implements Component {
return;
}
const kb = getEditorKeybindings();
if (kb.matches(keyData, "selectCancel")) {
const kb = getKeybindings();
if (kb.matches(keyData, "tui.select.cancel")) {
if (this.onCancel) {
this.onCancel();
}