From a2977751448d715f7abce1db5ab034171b1dcfaf Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Fri, 9 Apr 2021 15:34:59 +0000 Subject: [PATCH] validate cached guild --- tests/guilds/create_guild.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/guilds/create_guild.ts b/tests/guilds/create_guild.ts index 7520c74d0..1be0633c3 100644 --- a/tests/guilds/create_guild.ts +++ b/tests/guilds/create_guild.ts @@ -1,4 +1,4 @@ -import { createGuild, delay } from "../../mod.ts"; +import { cache, createGuild, delay } from "../../mod.ts"; import { defaultTestOptions, tempData } from "../ws/start_bot.ts"; import { assertEquals, assertExists } from "../deps.ts"; @@ -17,6 +17,8 @@ Deno.test({ // Delay the execution by 5 seconds to allow GUILD_CREATE event to be processed await delay(5000); + + if (!cache.guilds.has(guild.id)) throw new Error("The guild seemed to be created but it was not cached."); }, ...defaultTestOptions, });