Files
discordeno/tests/channels/get_channels.ts
2021-04-15 18:06:31 +02:00

23 lines
623 B
TypeScript

import { cache } from "../../src/cache.ts";
import { getChannels } from "../../src/helpers/channels/get_channels.ts";
import { assertEquals } from "../deps.ts";
import { delayUntil } from "../util/delay_until.ts";
import { defaultTestOptions, tempData } from "../ws/start_bot.ts";
Deno.test({
name: "[channel] get channels.",
async fn() {
cache.channels.clear();
// Delete the channel now without a reason
await getChannels(tempData.guildId);
await delayUntil(3000, () => cache.channels.size > 0);
assertEquals(
cache.channels.size > 0,
true,
);
},
...defaultTestOptions,
});