1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-07 23:02:56 +03:00

Refactor/simplify Promises in MatrixRTCSession (#4466)

* Refactor/simplify Promises in MatrixRTCSession

* Update src/matrixrtc/MatrixRTCSession.ts

Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>

* Fix+document+test leaveRoomSession's return value

* Throw instead of using expect in teardown

because lint rules forbid using expect outside of test functions

---------

Co-authored-by: Hugh Nimmo-Smith <hughns@users.noreply.github.com>
This commit is contained in:
Andrew Ferrazzutti
2024-10-25 05:24:52 -04:00
committed by GitHub
parent 23c4c9fd8a
commit b99ff83785
2 changed files with 19 additions and 17 deletions

View File

@@ -419,9 +419,13 @@ describe("MatrixRTCSession", () => {
sess = MatrixRTCSession.roomSessionForRoom(client, mockRoom);
});
afterEach(() => {
afterEach(async () => {
const wasJoined = sess!.isJoined();
// stop the timers
sess!.leaveRoomSession();
const left = await sess!.leaveRoomSession();
if (left !== wasJoined) {
throw new Error(`Unexpected leave result: wanted ${wasJoined}, got ${left}`);
}
});
it("starts un-joined", () => {