From e4df657e1a10a2963b30c85d255f8e83d6d8d9d4 Mon Sep 17 00:00:00 2001 From: TriForMine Date: Sat, 30 Oct 2021 08:30:05 +0000 Subject: [PATCH] change: prettier code --- tests/helpers/messages/editMessage.ts | 34 +++++++++++++-------------- tests/mod.ts | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/tests/helpers/messages/editMessage.ts b/tests/helpers/messages/editMessage.ts index 0ab4f2f8b..ba8b98efb 100644 --- a/tests/helpers/messages/editMessage.ts +++ b/tests/helpers/messages/editMessage.ts @@ -3,24 +3,24 @@ import { assertExists } from "../../deps.ts"; import { delayUntil } from "../../utils.ts"; export async function editMessageTest(bot: Bot, channelId: bigint, t: Deno.TestContext) { - const message = await bot.helpers.sendMessage(channelId, "Hello World!"); + const message = await bot.helpers.sendMessage(channelId, "Hello World!"); - // Assertions - assertExists(message); - // Delay the execution by to allow MESSAGE_CREATE event to be processed - await delayUntil(10000, () => bot.cache.messages.has(message.id)); - // Make sure the message was created. - if (!bot.cache.messages.has(message.id)) { - throw new Error("The message seemed to be sent but it was not cached. Reason: ${reason}"); - } + // Assertions + assertExists(message); + // Delay the execution by to allow MESSAGE_CREATE event to be processed + await delayUntil(10000, () => bot.cache.messages.has(message.id)); + // Make sure the message was created. + if (!bot.cache.messages.has(message.id)) { + throw new Error("The message seemed to be sent but it was not cached. Reason: ${reason}"); + } - // Delete the message now - await bot.helpers.editMessage(channelId, message.id, "Goodbye World!"); + // Delete the message now + await bot.helpers.editMessage(channelId, message.id, "Goodbye World!"); - // Wait to give it time for MESSAGE_UPDATE event - await delayUntil(10000, async () => (await bot.cache.messages.get(message.id))?.content === "Goodbye World!"); - // Make sure it was edited - if ((await bot.cache.messages.get(message.id))?.content !== "Goodbye World!") { - throw new Error("The message should have been edited but it was not."); - } + // Wait to give it time for MESSAGE_UPDATE event + await delayUntil(10000, async () => (await bot.cache.messages.get(message.id))?.content === "Goodbye World!"); + // Make sure it was edited + if ((await bot.cache.messages.get(message.id))?.content !== "Goodbye World!") { + throw new Error("The message should have been edited but it was not."); + } } diff --git a/tests/mod.ts b/tests/mod.ts index 1a4fa26ac..6ba923f98 100644 --- a/tests/mod.ts +++ b/tests/mod.ts @@ -111,7 +111,7 @@ Deno.test("[Bot] - Starting Tests", async (t) => { await editMessageTest(bot, channel.id, t); }, ...sanitizeMode, - }) + }), ]); }); });