Files
discordeno/testss/channels/deleteWithReason.test.ts
T
Skillz4KillzandLTS20050703 5a4fef855e Proxy delete channel tests (#2174)
* feat: delete channel tests

* fix: use new tests in ci

* Update testss/deps.ts

Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>

Co-authored-by: LTS20050703 <87189679+lts20050703@users.noreply.github.com>
2022-05-08 09:57:06 -04:00

24 lines
718 B
TypeScript

import { assertEquals, assertExists } from "../deps.ts";
import { loadBot } from "../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID, delayUntil } from "../utils.ts";
Deno.test({
name: "[channel] delete a channel with a reason",
async fn(t) {
const bot = loadBot();
const channel = await bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, {
name: "delete-channel",
});
// Make sure the channel was created
assertExists(channel.id);
// Delete the channel now with a reason
await bot.helpers.deleteChannel(channel.id, "with a reason");
// Check if channel still exists
const exists = await bot.helpers.getChannel(channel.id);
assertEquals(exists, undefined);
},
});