Follow snake_case convention

This commit is contained in:
Quentin Nicolini
2021-11-01 10:06:34 +01:00
parent 30e34a7aba
commit 8bffe996c4
6 changed files with 5 additions and 5 deletions
+35
View File
@@ -0,0 +1,35 @@
import { Bot } from "../../../src/bot.ts";
import { assertExists } from "../../deps.ts";
import { delayUntil } from "../../utils.ts";
export async function getEmojiTest(bot: Bot, guildId: bigint, t: Deno.TestContext) {
const emoji = await bot.helpers.createEmoji(guildId, {
name: "blamewolf",
image: "https://cdn.discordapp.com/emojis/814955268123000832.png",
roles: [],
});
// Assertions
assertExists(emoji);
// Delay the execution to allow event to be processed
await delayUntil(10000, async () => (await bot.cache.guilds.get(guildId))?.emojis?.has(emoji.id));
if (!(await bot.cache.guilds.get(guildId))?.emojis?.has(emoji.id)) {
throw new Error("The emoji seemed to be created but it was not cached.");
}
(await bot.cache.guilds.get(guildId))?.emojis?.delete(emoji.id);
const getEmoji = await bot.helpers.getEmoji(guildId, emoji.id, true);
// Assertions
assertExists(getEmoji);
// Delay the execution to allow event to be processed
await delayUntil(10000, async () => (await bot.cache.guilds.get(guildId))?.emojis?.has(emoji.id));
if (!(await bot.cache.guilds.get(guildId))?.emojis?.has(emoji.id)) {
throw new Error("The emoji didn't got added to cache after using the getEmoji function.");
}
}