test: tighten voice call config assertions · openclaw/openclaw@1b24dac
steipete
·
2026-05-10
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -34,22 +34,32 @@ describe("voice-call config compatibility", () => {
|
34 | 34 | }, |
35 | 35 | }); |
36 | 36 | |
37 | | -expect(normalized).toMatchObject({ |
38 | | -streaming: { |
39 | | -enabled: true, |
40 | | -provider: "openai", |
41 | | -providers: { |
42 | | -openai: { |
43 | | -apiKey: "sk-test", |
44 | | -model: "gpt-4o-transcribe", |
45 | | -silenceDurationMs: 700, |
46 | | -vadThreshold: 0.4, |
47 | | -}, |
48 | | -}, |
49 | | -}, |
| 37 | +const streaming = normalized.streaming as |
| 38 | +| { |
| 39 | +enabled?: boolean; |
| 40 | +provider?: string; |
| 41 | +providers?: { |
| 42 | +openai?: { |
| 43 | +apiKey?: string; |
| 44 | +model?: string; |
| 45 | +silenceDurationMs?: number; |
| 46 | +vadThreshold?: number; |
| 47 | +}; |
| 48 | +}; |
| 49 | +openaiApiKey?: unknown; |
| 50 | +sttModel?: unknown; |
| 51 | +} |
| 52 | +| undefined; |
| 53 | +expect(streaming?.enabled).toBe(true); |
| 54 | +expect(streaming?.provider).toBe("openai"); |
| 55 | +expect(streaming?.providers?.openai).toEqual({ |
| 56 | +apiKey: "sk-test", |
| 57 | +model: "gpt-4o-transcribe", |
| 58 | +silenceDurationMs: 700, |
| 59 | +vadThreshold: 0.4, |
50 | 60 | }); |
51 | | -expect((normalized.streaming as Record<string, unknown>).openaiApiKey).toBeUndefined(); |
52 | | -expect((normalized.streaming as Record<string, unknown>).sttModel).toBeUndefined(); |
| 61 | +expect(streaming?.openaiApiKey).toBeUndefined(); |
| 62 | +expect(streaming?.sttModel).toBeUndefined(); |
53 | 63 | }); |
54 | 64 | |
55 | 65 | it("reports doctor-oriented legacy issues and warnings", () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。