Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
Half-Shot committed May 31, 2019
1 parent 2370b4d commit 95cb6af
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 3 additions & 1 deletion test/test_discordbot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
"",
{
Expand All @@ -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);
});
});
// });
Expand Down

0 comments on commit 95cb6af

Please sign in to comment.