forked from mystiq/hydrogen-web
Refine test assertions
This commit is contained in:
parent
32c62641fd
commit
560ff2afb7
1 changed files with 2 additions and 2 deletions
|
@ -89,8 +89,8 @@ export function tests() {
|
||||||
}
|
}
|
||||||
|
|
||||||
const assertList = function (assert, rooms, gotList, wantListRoomIds) {
|
const assertList = function (assert, rooms, gotList, wantListRoomIds) {
|
||||||
|
assert.equal(wantListRoomIds.length, gotList.length);
|
||||||
if (wantListRoomIds.length === 0) {
|
if (wantListRoomIds.length === 0) {
|
||||||
assert.equal(gotList.length, 0);
|
|
||||||
for (const room of gotList) {
|
for (const room of gotList) {
|
||||||
assert.equal(0, 1); // fail
|
assert.equal(0, 1); // fail
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ export function tests() {
|
||||||
for (const room of gotList) {
|
for (const room of gotList) {
|
||||||
const wantRoomId = wantListRoomIds[i];
|
const wantRoomId = wantListRoomIds[i];
|
||||||
const gotRoomId = room ? room.id : null;
|
const gotRoomId = room ? room.id : null;
|
||||||
assert.equal(wantRoomId, gotRoomId);
|
assert.strictEqual(wantRoomId, gotRoomId);
|
||||||
if (wantRoomId !== null && gotRoomId !== null) {
|
if (wantRoomId !== null && gotRoomId !== null) {
|
||||||
assert.deepEqual(room, rooms.get(wantRoomId));
|
assert.deepEqual(room, rooms.get(wantRoomId));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue