test(ci): stabilize plugin prerelease async waits (#117684)

* test(voice-call): await replaced bridge cleanup

* test(mistral): await runaway transcript error
This commit is contained in:
Vincent Koc
2026-08-02 07:31:34 +08:00
committed by GitHub
parent b359b2328d
commit 2f06ed30d8
2 changed files with 9 additions and 2 deletions
@@ -378,7 +378,11 @@ describe("buildMistralRealtimeTranscriptionProvider", () => {
{ type: "transcription.segment", text: "late segment", start: 0, end: 1 },
{ type: "transcription.done", text: "late done" },
]);
const onError = vi.fn();
let resolveError: (() => void) | undefined;
const errorReceived = new Promise<void>((resolve) => {
resolveError = resolve;
});
const onError = vi.fn(() => resolveError?.());
const onTranscript = vi.fn();
let lastPartialLength = 0;
let partialCalls = 0;
@@ -393,6 +397,7 @@ describe("buildMistralRealtimeTranscriptionProvider", () => {
});
await session.connect();
await errorReceived;
await vi.waitFor(() => {
expect(onError).toHaveBeenCalledExactlyOnceWith(
expect.objectContaining({
@@ -1944,7 +1944,9 @@ describe("RealtimeCallHandler path routing", () => {
const oldClosed = waitForClose(oldWs);
callbacks[0]?.onClose?.("error");
await oldClosed;
expect(oldCloseBridge).toHaveBeenCalledOnce();
await waitForRealtimeTest(() => {
expect(oldCloseBridge).toHaveBeenCalledOnce();
});
expect(replacementCloseBridge).not.toHaveBeenCalled();
expect(hangupCall).not.toHaveBeenCalled();
expect(