From cc9f393ed7696c8f0d511da0f9dfe8f874eb4563 Mon Sep 17 00:00:00 2001 From: Jonathan de Jong Date: Tue, 3 May 2022 12:20:40 +0200 Subject: [PATCH] fix CI (#282) ts-mocha has also been updated to make running locally possible (else it gives a confusing error that tsconfig.json is not "json" or the likes) --- package.json | 2 +- test/integration/commands/makedminCommandTest.ts | 4 ++-- test/integration/roomMembersTest.ts | 3 +++ test/integration/standardConsequenceTest.ts | 2 +- yarn.lock | 8 ++++---- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 200ae778..889d8154 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "eslint": "^7.32", "expect": "^27.0.6", "mocha": "^9.0.1", - "ts-mocha": "^8.0.0", + "ts-mocha": "^9.0.2", "tslint": "^6.1.3", "typescript": "^4.3.5", "typescript-formatter": "^7.2" diff --git a/test/integration/commands/makedminCommandTest.ts b/test/integration/commands/makedminCommandTest.ts index 87e11522..115de568 100644 --- a/test/integration/commands/makedminCommandTest.ts +++ b/test/integration/commands/makedminCommandTest.ts @@ -30,7 +30,7 @@ describe("Test: The make admin command", function () { await moderator.joinRoom(config.managementRoom); LogService.debug("makeadminTest", `Joining managementRoom: ${config.managementRoom}`); - let targetRoom = await moderator.createRoom({ invite: [mjolnirUserId] }); + let targetRoom = await moderator.createRoom({ invite: [mjolnirUserId], preset: "public_chat" }); LogService.debug("makeadminTest", `moderator creating targetRoom: ${targetRoom}; and inviting ${mjolnirUserId}`); await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text.', body: `!mjolnir rooms add ${targetRoom}` }); LogService.debug("makeadminTest", `Adding targetRoom: ${targetRoom}`); @@ -90,7 +90,7 @@ describe("Test: The make admin command", function () { try { await moderator.start(); powerLevels = await userA.getRoomStateEvent(targetRoom, "m.room.power_levels", ""); - assert.notEqual(powerLevels["users"][userBId], 100, `User B should not yet be an admin of ${targetRoom}`); + assert.notEqual(powerLevels["users"][userBId], 100, `User B should not yet be an admin of ${targetRoom}`); await getFirstReaction(mjolnir, this.mjolnir.managementRoomId, '✅', async () => { LogService.debug("makeadminTest", `Sending: !mjolnir make admin ${targetRoom} ${userBId}`); return await moderator.sendMessage(this.mjolnir.managementRoomId, { msgtype: 'm.text', body: `!mjolnir make admin ${targetRoom} ${userBId}` }); diff --git a/test/integration/roomMembersTest.ts b/test/integration/roomMembersTest.ts index 9e3c2cc0..617b9b8f 100644 --- a/test/integration/roomMembersTest.ts +++ b/test/integration/roomMembersTest.ts @@ -258,6 +258,7 @@ describe("Test: Testing RoomMemberManager", function() { // Setup a moderator. this.moderator = await newTestUser({ name: { contains: "moderator" } }); + await this.mjolnir.client.inviteUser(await this.moderator.getUserId(), this.mjolnir.managementRoomId) await this.moderator.joinRoom(this.mjolnir.managementRoomId); // Create a few users and two rooms. @@ -272,9 +273,11 @@ describe("Test: Testing RoomMemberManager", function() { } const roomId1 = await this.moderator.createRoom({ invite: userIds, + preset: "public_chat", }); const roomId2 = await this.moderator.createRoom({ invite: userIds, + preset: "public_chat", }); const roomIds = [roomId1, roomId2]; diff --git a/test/integration/standardConsequenceTest.ts b/test/integration/standardConsequenceTest.ts index 68048fd9..a5fcd7ae 100644 --- a/test/integration/standardConsequenceTest.ts +++ b/test/integration/standardConsequenceTest.ts @@ -114,7 +114,7 @@ describe("Test: standard consequences", function() { it("Mjolnir doesn't ban a good user", async function() { this.timeout(20000); - let protectedRoomId = await this.mjolnir.client.createRoom({ invite: [await goodUser.getUserId()] }); + let protectedRoomId = await this.mjolnir.client.createRoom({ invite: [await goodUser.getUserId(), await badUser.getUserId()] }); await badUser.joinRoom(protectedRoomId); await goodUser.joinRoom(protectedRoomId); await this.mjolnir.addProtectedRoom(protectedRoomId); diff --git a/yarn.lock b/yarn.lock index b0541368..21df7154 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2757,10 +2757,10 @@ tr46@^2.1.0: dependencies: punycode "^2.1.1" -ts-mocha@^8.0.0: - version "8.0.0" - resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-8.0.0.tgz#962d0fa12eeb6468aa1a6b594bb3bbc818da3ef0" - integrity sha512-Kou1yxTlubLnD5C3unlCVO7nh0HERTezjoVhVw/M5S1SqoUec0WgllQvPk3vzPMc6by8m6xD1uR1yRf8lnVUbA== +ts-mocha@^9.0.2: + version "9.0.2" + resolved "https://registry.yarnpkg.com/ts-mocha/-/ts-mocha-9.0.2.tgz#c1ef0248874d04a0f26dd9bd8d88e617a8d82ab1" + integrity sha512-WyQjvnzwrrubl0JT7EC1yWmNpcsU3fOuBFfdps30zbmFBgKniSaSOyZMZx+Wq7kytUs5CY+pEbSYEbGfIKnXTw== dependencies: ts-node "7.0.1" optionalDependencies: