Skip to content
Extraits de code Groupes Projets
Valider 597bebdd rédigé par Will Hunt's avatar Will Hunt
Parcourir les fichiers

Fix tests

parent 16bd1a1a
Branches
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -106,6 +106,7 @@ export class DiscordBot { ...@@ -106,6 +106,7 @@ export class DiscordBot {
// init vars // init vars
this.sentMessages = []; this.sentMessages = [];
this.discordMessageQueue = {}; this.discordMessageQueue = {};
this.channelLocks = {};
this.lastEventIds = {}; this.lastEventIds = {};
} }
...@@ -183,7 +184,6 @@ export class DiscordBot { ...@@ -183,7 +184,6 @@ export class DiscordBot {
public async run(): Promise<void> { public async run(): Promise<void> {
const client = await this.clientFactory.getClient(); const client = await this.clientFactory.getClient();
if (!this.config.bridge.disableTypingNotifications) { if (!this.config.bridge.disableTypingNotifications) {
client.on("typingStart", async (c, u) => { client.on("typingStart", async (c, u) => {
try { try {
......
...@@ -382,7 +382,7 @@ describe("DiscordBot", () => { ...@@ -382,7 +382,7 @@ describe("DiscordBot", () => {
const CHANID = 123; const CHANID = 123;
// Send delay of 50ms, 2 seconds / 50ms - 5 for safety. // Send delay of 50ms, 2 seconds / 50ms - 5 for safety.
for (let i = 0; i < ITERATIONS; i++) { for (let i = 0; i < ITERATIONS; i++) {
await client.emit("message", { n: i, channel: { id: CHANID} }); await client.emit("message", { channel: { guild: { id: CHANID }, id: CHANID} });
} }
await discordBot.discordMessageQueue[CHANID]; await discordBot.discordMessageQueue[CHANID];
}); });
...@@ -409,7 +409,7 @@ describe("DiscordBot", () => { ...@@ -409,7 +409,7 @@ describe("DiscordBot", () => {
const CHANID = 123; const CHANID = 123;
// Send delay of 50ms, 2 seconds / 50ms - 5 for safety. // Send delay of 50ms, 2 seconds / 50ms - 5 for safety.
for (let n = 0; n < ITERATIONS; n++) { for (let n = 0; n < ITERATIONS; n++) {
await client.emit("message", { n, channel: { id: CHANID} }); await client.emit("message", { n, channel: { guild: { id: CHANID }, id: CHANID} });
} }
await discordBot.discordMessageQueue[CHANID]; await discordBot.discordMessageQueue[CHANID];
assert.equal(expected, ITERATIONS); assert.equal(expected, ITERATIONS);
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter