@@ -544,7 +544,7 @@ function expectToolText(result: unknown, text: string): void {
|
544 | 544 | } |
545 | 545 | |
546 | 546 | function firstImageRequest(mock: { mock: { calls: unknown[][] } }): ImageDescriptionRequest { |
547 | | -const request = mock.mock.calls[0]?.[0]; |
| 547 | +const request = mock.mock.calls.at(0)?.[0]; |
548 | 548 | if (!request) { |
549 | 549 | throw new Error("expected describeImage call"); |
550 | 550 | } |
@@ -1192,7 +1192,7 @@ describe("image tool implicit imageModel config", () => {
|
1192 | 1192 | }); |
1193 | 1193 | |
1194 | 1194 | expect(fetch).toHaveBeenCalledTimes(1); |
1195 | | -const [url, init] = fetch.mock.calls[0] as [unknown, { body?: unknown }]; |
| 1195 | +const [url, init] = fetchCallAt(fetch, 0) as [unknown, { body?: unknown }]; |
1196 | 1196 | expect(String(url)).toBe("https://api.moonshot.ai/v1/chat/completions"); |
1197 | 1197 | expect(typeof init?.body).toBe("string"); |
1198 | 1198 | const bodyRaw = typeof init?.body === "string" ? init.body : ""; |
@@ -1670,7 +1670,10 @@ describe("image tool MiniMax VLM routing", () => {
|
1670 | 1670 | }); |
1671 | 1671 | |
1672 | 1672 | expect(fetch).toHaveBeenCalledTimes(1); |
1673 | | -const [url, init] = fetch.mock.calls[0]; |
| 1673 | +const [url, init] = fetchCallAt(fetch, 0) as [ |
| 1674 | +unknown, |
| 1675 | +{ body?: unknown; headers?: unknown; method?: unknown }, |
| 1676 | +]; |
1674 | 1677 | expect(String(url)).toBe("https://api.minimax.io/v1/coding_plan/vlm"); |
1675 | 1678 | expect(init?.method).toBe("POST"); |
1676 | 1679 | expect((init?.headers as Record<string, string>)?.Authorization).toBe("Bearer minimax-test"); |
|