mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 00:10:07 +00:00
25 lines
749 B
TypeScript
25 lines
749 B
TypeScript
import { cache } from "../../src/cache.ts";
|
|
import { deleteServer } from "../../src/helpers/guilds/delete_server.ts";
|
|
import { delay } from "../../src/util/utils.ts";
|
|
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
|
|
|
|
Deno.test({
|
|
name: "[guild] delete a guild",
|
|
async fn() {
|
|
if (!tempData.guildId) {
|
|
throw new Error("The guild id was not available to be deleted.");
|
|
}
|
|
if (!cache.guilds.has(tempData.guildId)) {
|
|
throw new Error("The guild was not cached so impossible to delete.");
|
|
}
|
|
|
|
await deleteServer(tempData.guildId);
|
|
await delay(3000);
|
|
|
|
if (cache.guilds.has(tempData.guildId)) {
|
|
throw new Error("The guild was not able to be deleted.");
|
|
}
|
|
},
|
|
...defaultTestOptions,
|
|
});
|