mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-13 17:40:44 +00:00
test: tighten voice call config assertions
This commit is contained in:
@@ -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<string, unknown>).openaiApiKey).toBeUndefined();
|
||||
expect((normalized.streaming as Record<string, unknown>).sttModel).toBeUndefined();
|
||||
expect(streaming?.openaiApiKey).toBeUndefined();
|
||||
expect(streaming?.sttModel).toBeUndefined();
|
||||
});
|
||||
|
||||
it("reports doctor-oriented legacy issues and warnings", () => {
|
||||
|
||||
@@ -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"]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user