From 1695d3f5180af85f0c431e41a50a2f2e25fd4280 Mon Sep 17 00:00:00 2001 From: Robin Date: Thu, 10 Sep 2026 21:15:48 +0200 Subject: [PATCH] Use flushPromises for readability --- src/livekit/TrackProcessorContext.test.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/livekit/TrackProcessorContext.test.ts b/src/livekit/TrackProcessorContext.test.ts index 96a04aa4f..5b977bd4d 100644 --- a/src/livekit/TrackProcessorContext.test.ts +++ b/src/livekit/TrackProcessorContext.test.ts @@ -14,7 +14,7 @@ import { import { applyProcessor, trackProcessorSync } from "./TrackProcessorContext"; import { constant } from "../state/Behavior"; -import { testScope } from "../utils/test"; +import { flushPromises, testScope } from "../utils/test"; const processor = {} as ProcessorWrapper; @@ -51,7 +51,7 @@ describe("applyProcessor", () => { const unhandled = vi.fn(); process.on("unhandledRejection", unhandled); applyProcessor(track, processor); - await new Promise((r) => setTimeout(r, 0)); + await flushPromises(); process.off("unhandledRejection", unhandled); expect(unhandled).not.toHaveBeenCalled(); }); @@ -68,7 +68,7 @@ describe("applyProcessor", () => { const unhandled = vi.fn(); process.on("unhandledRejection", unhandled); applyProcessor(track, undefined); - await new Promise((r) => setTimeout(r, 0)); + await flushPromises(); process.off("unhandledRejection", unhandled); expect(unhandled).not.toHaveBeenCalled(); });