From 560ff2afb7960a82cdbb4ec0288895804414ae00 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 3 Dec 2021 13:54:19 +0000 Subject: [PATCH] Refine test assertions --- src/matrix/Sync3ObservableList.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/matrix/Sync3ObservableList.ts b/src/matrix/Sync3ObservableList.ts index fdad67d9..70028a08 100644 --- a/src/matrix/Sync3ObservableList.ts +++ b/src/matrix/Sync3ObservableList.ts @@ -89,8 +89,8 @@ export function tests() { } const assertList = function (assert, rooms, gotList, wantListRoomIds) { + assert.equal(wantListRoomIds.length, gotList.length); if (wantListRoomIds.length === 0) { - assert.equal(gotList.length, 0); for (const room of gotList) { assert.equal(0, 1); // fail } @@ -100,7 +100,7 @@ export function tests() { for (const room of gotList) { const wantRoomId = wantListRoomIds[i]; const gotRoomId = room ? room.id : null; - assert.equal(wantRoomId, gotRoomId); + assert.strictEqual(wantRoomId, gotRoomId); if (wantRoomId !== null && gotRoomId !== null) { assert.deepEqual(room, rooms.get(wantRoomId)); }