test: tighten realtime websocket timeout assertion · openclaw/openclaw@781c351
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
File tree
src/realtime-transcription
| Original file line number | Diff line number | Diff line change |
|---|
@@ -183,10 +183,10 @@ describe("createRealtimeTranscriptionWebSocketSession", () => {
|
183 | 183 | "test realtime transcription connection timeout", |
184 | 184 | ); |
185 | 185 | expect(session.isConnected()).toBe(false); |
186 | | -expect(onError).toHaveBeenCalledWith(expect.any(Error)); |
187 | | -expect(onError.mock.calls[0]?.[0]).toMatchObject({ |
188 | | - message: "test realtime transcription connection timeout", |
189 | | -}); |
| 186 | +expect(onError).toHaveBeenCalledTimes(1); |
| 187 | +const timeoutError = onError.mock.calls[0]?.[0]; |
| 188 | +expect(timeoutError).toBeInstanceOf(Error); |
| 189 | +expect(timeoutError.message).toBe("test realtime transcription connection timeout"); |
190 | 190 | }); |
191 | 191 | |
192 | 192 | it("does not open a socket when closed while async connection resolves", async () => { |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。