






















@@ -44,15 +44,15 @@ const officialEndpointValidationCases = [
4444];
45454646function firstFetchCall(fetchMock: ReturnType<typeof vi.fn>): unknown[] {
47-const call = fetchMock.mock.calls.at(0);
47+const call = fetchMock.mock.calls[0];
4848if (!call) {
4949throw new Error("expected fetch call");
5050}
5151return call;
5252}
53535454function firstFetchInit(fetchMock: ReturnType<typeof vi.fn>): RequestInit {
55-const init = firstFetchCall(fetchMock).at(1);
55+const init = firstFetchCall(fetchMock)[1];
5656if (!init || typeof init !== "object") {
5757throw new Error("expected fetch init");
5858}
@@ -164,7 +164,7 @@ describe("openai tts", () => {
164164timeoutMs: 5_000,
165165});
166166167-const url = firstFetchCall(fetchMock).at(0);
167+const url = firstFetchCall(fetchMock)[0];
168168const init = firstFetchInit(fetchMock);
169169const headers = init?.headers as Record<string, string> | undefined;
170170expect(url).toBe("https://api.openai.com/v1/audio/speech");
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。