Conform more of the codebase to strictNullChecks (#10504

* Conform more of the codebase to `strictNullChecks`

* Iterate
This commit is contained in:
Michael Telatynski 2023-04-04 11:41:46 +01:00 committed by GitHub
parent 6db0c7a1a6
commit bc60a9b594
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 60 additions and 54 deletions

View file

@ -163,8 +163,9 @@ describe("DMRoomMap", () => {
beforeEach(() => {
client.getAccountData.mockReturnValue(mkMDirectEvent(mDirectContent));
client.getRoom.mockImplementation((roomId: string) =>
[bigRoom, smallRoom, dmWithCharlie, dmWithBob].find((room) => room.roomId === roomId),
client.getRoom.mockImplementation(
(roomId: string) =>
[bigRoom, smallRoom, dmWithCharlie, dmWithBob].find((room) => room.roomId === roomId) ?? null,
);
});
@ -183,7 +184,7 @@ describe("DMRoomMap", () => {
});
it("excludes rooms that are not found by matrixClient", () => {
client.getRoom.mockReset().mockReturnValue(undefined);
client.getRoom.mockReset().mockReturnValue(null);
const dmRoomMap = new DMRoomMap(client);
dmRoomMap.start();
expect(dmRoomMap.getUniqueRoomsWithIndividuals()).toEqual({});