mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-02 00:40:07 +00:00
test: add getChannels test
This commit is contained in:
@@ -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);
|
||||
});
|
||||
18
testss/channels/getChannels.test.ts
Normal file
18
testss/channels/getChannels.test.ts
Normal 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);
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user