Files
discordeno/tests/helpers/guilds/createGuild.ts
ITOH 81f8e0377c style: move to deno fmt (#1992)
* Create deno.json

* run format

* run format

* ci: only check formatting

* f

* Update settings.json

* Update settings.json
2022-02-04 15:00:04 +01:00

20 lines
552 B
TypeScript

import { assertEquals, assertExists } from "../../deps.ts";
import { bot } from "../../mod.ts";
import { delayUntil } from "../../utils.ts";
export async function createGuildTests() {
const guild = await bot.helpers.createGuild({
name: "Isekai Maid Fake Server",
});
// Assertions
assertExists(guild);
// Delay the execution to allow event to be processed
await delayUntil(10000, () => bot.guilds.has(guild.id));
if (!bot.guilds.has(guild.id)) {
throw new Error(`The guild seemed to be created but it was not cached.`);
}
}