test: add getChannels test

This commit is contained in:
Skillz4Killz
2022-05-08 17:49:35 +00:00
committed by GitHub
parent e9727d3d10
commit 3752cda0c3
2 changed files with 18 additions and 13 deletions

View File

@@ -1,13 +0,0 @@
import { assertEquals } from "../deps.ts";
import { bot, guild } from "../mod.ts";
Deno.test("[channel] Get all channels", async () => {
await Promise.all([
bot.helpers.createChannel(guild.id, { name: "first" }),
bot.helpers.createChannel(guild.id, { name: "second" }),
]);
const channels = await bot.helpers.getChannels(guild.id);
assertEquals(channels.size > 1, true);
});

View File

@@ -0,0 +1,18 @@
import { assertEquals } from "../deps.ts";
import { loadBot } from "../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID } from "../utils.ts";
Deno.test({
name: "[channel] Get all channels",
async fn() {
const bot = loadBot();
await Promise.all([
bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, { name: "first" }),
bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, { name: "second" }),
]);
const channels = await bot.helpers.getChannels(CACHED_COMMUNITY_GUILD_ID);
assertEquals(channels.size > 1, true);
},
});