mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-05 22:00:21 +00:00
fix(ci): restore main green
This commit is contained in:
@@ -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)");
|
||||
});
|
||||
|
||||
@@ -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" },
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user