From 8b5e39f7960072bafb7e102af12c715c62fd71fa Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Fri, 9 Apr 2021 17:35:34 +0000 Subject: [PATCH] deno fmt --- tests/channels/create_channel.ts | 4 +- tests/channels/delete_channel.ts | 64 +++++++++++++++++--------------- 2 files changed, 37 insertions(+), 31 deletions(-) diff --git a/tests/channels/create_channel.ts b/tests/channels/create_channel.ts index cb4fafcfb..2e6e5012c 100644 --- a/tests/channels/create_channel.ts +++ b/tests/channels/create_channel.ts @@ -19,7 +19,9 @@ Deno.test({ await delay(5000); if (!cache.channels.has(channel.id)) { - throw new Error("The channel seemed to be created but it was not cached."); + throw new Error( + "The channel seemed to be created but it was not cached.", + ); } }, ...defaultTestOptions, diff --git a/tests/channels/delete_channel.ts b/tests/channels/delete_channel.ts index 3afbe5c4c..401b91170 100644 --- a/tests/channels/delete_channel.ts +++ b/tests/channels/delete_channel.ts @@ -11,48 +11,52 @@ Deno.test({ // wait 5 seconds to give it time for CHANNEL_CREATE event await delay(5000); // Make sure the channel was created. - if (!cache.channels.has(channel.id)) + if (!cache.channels.has(channel.id)) { throw new Error( - "The channel should have been created but it is not in the cache." + "The channel should have been created but it is not in the cache.", ); + } // Delete the channel now without a reason await deleteChannel(tempData.guildId, channel.id); // wait 5 seconds to give it time for CHANNEL_DELETE event await delay(5000); // Make sure it is gone from cache - if (cache.channels.has(channel.id)) + if (cache.channels.has(channel.id)) { throw new Error( - "The channel should have been deleted but it is still in cache." + "The channel should have been deleted but it is still in cache.", ); + } }, ...defaultTestOptions, }); Deno.test({ - name: "[channel] delete a channel with a reason.", - async fn() { - // Create the necessary channels - const channel = await createChannel(tempData.guildId, { - name: "delete-channel", - }); - // wait 5 seconds to give it time for CHANNEL_CREATE event - await delay(5000); - // Make sure the channel was created. - if (!cache.channels.has(channel.id)) - throw new Error( - "The channel should have been created but it is not in the cache." - ); - - // Delete the channel now without a reason - await deleteChannel(tempData.guildId, channel.id, "with a reason"); - // wait 5 seconds to give it time for CHANNEL_DELETE event - await delay(5000); - // Make sure it is gone from cache - if (cache.channels.has(channel.id)) - throw new Error( - "The channel should have been deleted but it is still in cache." - ); - }, - ...defaultTestOptions, - }); \ No newline at end of file + name: "[channel] delete a channel with a reason.", + async fn() { + // Create the necessary channels + const channel = await createChannel(tempData.guildId, { + name: "delete-channel", + }); + // wait 5 seconds to give it time for CHANNEL_CREATE event + await delay(5000); + // Make sure the channel was created. + if (!cache.channels.has(channel.id)) { + throw new Error( + "The channel should have been created but it is not in the cache.", + ); + } + + // Delete the channel now without a reason + await deleteChannel(tempData.guildId, channel.id, "with a reason"); + // wait 5 seconds to give it time for CHANNEL_DELETE event + await delay(5000); + // Make sure it is gone from cache + if (cache.channels.has(channel.id)) { + throw new Error( + "The channel should have been deleted but it is still in cache.", + ); + } + }, + ...defaultTestOptions, +});