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