test: tighten websocket session error assertions

This commit is contained in:
Peter Steinberger
2026-05-09 11:40:55 +01:00
parent f21b93e896
commit 85a28d02ca

View File

@@ -164,7 +164,7 @@ describe("createRealtimeTranscriptionWebSocketSession", () => {
expect(onError).toHaveBeenCalledTimes(1);
const setupError = onError.mock.calls[0]?.[0];
expect(setupError).toBeInstanceOf(Error);
expect(setupError).toMatchObject({ message: "nope" });
expect(setupError.message).toBe("nope");
});
it("reports pre-ready closes separately from connection timeouts", async () => {
@@ -187,8 +187,6 @@ describe("createRealtimeTranscriptionWebSocketSession", () => {
expect(onError).toHaveBeenCalledTimes(1);
const closeError = onError.mock.calls[0]?.[0];
expect(closeError).toBeInstanceOf(Error);
expect(closeError).toMatchObject({
message: "test realtime transcription connection closed before ready",
});
expect(closeError.message).toBe("test realtime transcription connection closed before ready");
});
});