From a775bcd62a434cad4d20cdcb9f8a1339090d0806 Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Thu, 28 Aug 2025 10:09:49 -0400 Subject: [PATCH] Migrate from js-sdk's `defer` in test See: matrix-org/matrix-js-sdk#4959 --- src/livekit/useECConnectionState.test.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/livekit/useECConnectionState.test.tsx b/src/livekit/useECConnectionState.test.tsx index 72324884..8abbf438 100644 --- a/src/livekit/useECConnectionState.test.tsx +++ b/src/livekit/useECConnectionState.test.tsx @@ -15,7 +15,7 @@ import { import userEvent from "@testing-library/user-event"; import { render, screen } from "@testing-library/react"; import { MemoryRouter } from "react-router-dom"; -import { defer, sleep } from "matrix-js-sdk/lib/utils"; +import { sleep } from "matrix-js-sdk/lib/utils"; import { useECConnectionState } from "./useECConnectionState"; import { type SFUConfig } from "./openIDSFU"; @@ -93,7 +93,7 @@ describe("Leaking connection prevention", () => { test("Should cancel pending connections when the component is unmounted", async () => { const connectCall = vi.fn(); - const pendingConnection = defer(); + const pendingConnection = Promise.withResolvers(); // let pendingDisconnection = defer() const disconnectMock = vi.fn(); @@ -141,7 +141,7 @@ describe("Leaking connection prevention", () => { test("Should cancel about to open but not yet opened connection", async () => { const createTracksCall = vi.fn(); - const pendingCreateTrack = defer(); + const pendingCreateTrack = Promise.withResolvers(); // let pendingDisconnection = defer() const disconnectMock = vi.fn(); const connectMock = vi.fn();