From 22430301390c6ddb11991aea2e6c4ec33339fc7e Mon Sep 17 00:00:00 2001
From: Will Hunt <will@half-shot.uk>
Date: Fri, 31 May 2019 16:18:11 +0100
Subject: [PATCH] Linting

---
 src/bot.ts              | 2 +-
 test/test_discordbot.ts | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/src/bot.ts b/src/bot.ts
index 388b017..fc8b34f 100644
--- a/src/bot.ts
+++ b/src/bot.ts
@@ -776,7 +776,7 @@ export class DiscordBot {
         let rooms;
         try {
             rooms = await this.channelSync.GetRoomIdsFromChannel(msg.channel);
-            if (rooms === null) { throw Error() }
+            if (rooms === null) { throw Error(); }
         } catch (err) {
             log.verbose("No bridged rooms to send message to. Oh well.");
             MetricPeg.get.requestOutcome(msg.id, true, "dropped");
diff --git a/test/test_discordbot.ts b/test/test_discordbot.ts
index 1735170..918ff46 100644
--- a/test/test_discordbot.ts
+++ b/test/test_discordbot.ts
@@ -434,6 +434,7 @@ describe("DiscordBot", () => {
         it("should lock and unlock a channel early, if unlocked", async () => {
             const discordSendDelay = 500;
             const SHORTDELAY = 100;
+            const MINEXPECTEDDELAY = 95;
             const bot = new modDiscordBot.DiscordBot(
                 "",
                 {
@@ -453,7 +454,8 @@ describe("DiscordBot", () => {
             bot.lockChannel(chan);
             await bot.waitUnlock(chan);
             const diff = Date.now() - t;
-            expect(diff).to.be.greaterThan(SHORTDELAY - 5);
+            // Date accuracy can be off by a few ms sometimes.
+            expect(diff).to.be.greaterThan(MINEXPECTEDDELAY);
         });
     });
   // });
-- 
GitLab