From 7bb2153fb2cdf2bbfdd944081bedf4fa48fa1277 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Wed, 13 May 2026 06:23:44 +0100 Subject: [PATCH] test: dedupe openai tts mock reads --- extensions/openai/tts.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extensions/openai/tts.test.ts b/extensions/openai/tts.test.ts index 0f60fc3283a..56df32c6965 100644 --- a/extensions/openai/tts.test.ts +++ b/extensions/openai/tts.test.ts @@ -44,7 +44,7 @@ const officialEndpointValidationCases = [ ]; function firstFetchCall(fetchMock: ReturnType): unknown[] { - const call = fetchMock.mock.calls.at(0); + const call = fetchMock.mock.calls[0]; if (!call) { throw new Error("expected fetch call"); } @@ -52,7 +52,7 @@ function firstFetchCall(fetchMock: ReturnType): unknown[] { } function firstFetchInit(fetchMock: ReturnType): RequestInit { - const init = firstFetchCall(fetchMock).at(1); + const init = firstFetchCall(fetchMock)[1]; if (!init || typeof init !== "object") { throw new Error("expected fetch init"); } @@ -164,7 +164,7 @@ describe("openai tts", () => { timeoutMs: 5_000, }); - const url = firstFetchCall(fetchMock).at(0); + const url = firstFetchCall(fetchMock)[0]; const init = firstFetchInit(fetchMock); const headers = init?.headers as Record | undefined; expect(url).toBe("https://api.openai.com/v1/audio/speech");