From 1b24dacff2276442ff0ee5167ffcd22523f1ff5d Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 9 May 2026 21:22:09 +0100 Subject: [PATCH] test: tighten voice call config assertions --- .../voice-call/src/config-compat.test.ts | 40 ++++++++++++------- .../voice-call/src/voice-mapping.test.ts | 4 +- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/extensions/voice-call/src/config-compat.test.ts b/extensions/voice-call/src/config-compat.test.ts index 9c59c093dbe..d555b9c3ae5 100644 --- a/extensions/voice-call/src/config-compat.test.ts +++ b/extensions/voice-call/src/config-compat.test.ts @@ -34,22 +34,32 @@ describe("voice-call config compatibility", () => { }, }); - expect(normalized).toMatchObject({ - streaming: { - enabled: true, - provider: "openai", - providers: { - openai: { - apiKey: "sk-test", - model: "gpt-4o-transcribe", - silenceDurationMs: 700, - vadThreshold: 0.4, - }, - }, - }, + const streaming = normalized.streaming as + | { + enabled?: boolean; + provider?: string; + providers?: { + openai?: { + apiKey?: string; + model?: string; + silenceDurationMs?: number; + vadThreshold?: number; + }; + }; + openaiApiKey?: unknown; + sttModel?: unknown; + } + | undefined; + expect(streaming?.enabled).toBe(true); + expect(streaming?.provider).toBe("openai"); + expect(streaming?.providers?.openai).toEqual({ + apiKey: "sk-test", + model: "gpt-4o-transcribe", + silenceDurationMs: 700, + vadThreshold: 0.4, }); - expect((normalized.streaming as Record).openaiApiKey).toBeUndefined(); - expect((normalized.streaming as Record).sttModel).toBeUndefined(); + expect(streaming?.openaiApiKey).toBeUndefined(); + expect(streaming?.sttModel).toBeUndefined(); }); it("reports doctor-oriented legacy issues and warnings", () => { diff --git a/extensions/voice-call/src/voice-mapping.test.ts b/extensions/voice-call/src/voice-mapping.test.ts index 4ce63a324c2..ef4b24d6a6d 100644 --- a/extensions/voice-call/src/voice-mapping.test.ts +++ b/extensions/voice-call/src/voice-mapping.test.ts @@ -27,8 +27,6 @@ describe("voice mapping", () => { expect(isOpenAiVoice("nova")).toBe(true); expect(isOpenAiVoice("NOVA")).toBe(true); expect(isOpenAiVoice("Polly.Joanna")).toBe(false); - expect(getOpenAiVoiceNames()).toEqual( - expect.arrayContaining(["alloy", "echo", "fable", "nova", "onyx", "shimmer"]), - ); + expect(getOpenAiVoiceNames()).toEqual(["alloy", "echo", "fable", "onyx", "nova", "shimmer"]); }); });