mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 09:50:07 +00:00
* style: format Deno.test\("(.+)", async \(\) => \{\n([\S\s]*?)^\}\);
* style: format Deno.test\("(.+)", \(\) => \{\n([\S\s]*?)^\}\);
* style: format Deno.test\("(.+)", async \(t\) => \{\n([\S\s]*?)^\}\);
* style: format async function
* chore: turn all to async
* chore: format add t
* style: function format
* chore: add integration and unit test difference
* ci: combine test
* ci: remove if
* ci: add parallel flag
* ci: add UNIT_TEST_GUILD_ID
* ci: static deno version
* ci: add concurrency to Integration test
* ci: bump actions/checkout to v3
24 lines
740 B
TypeScript
24 lines
740 B
TypeScript
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",
|
|
ignore: Deno.env.get("TEST_ENV") === "UNIT",
|
|
async fn(t) {
|
|
const bot = loadBot();
|
|
const [first, second] = 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);
|
|
|
|
await Promise.all(
|
|
[bot.helpers.deleteChannel(first.id), bot.helpers.deleteChannel(second.id)],
|
|
);
|
|
},
|
|
});
|