Files
discordeno/tests/channels/createVoiceWithBitrate.test.ts
Jonathan Ho 1c7859fea9 Test: clean up CI and test (#2555)
* 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
2022-10-26 10:41:26 -05:00

31 lines
1017 B
TypeScript

import { ChannelTypes } from "../../mod.ts";
import { assertEquals, assertExists } from "../deps.ts";
import { loadBot } from "../mod.ts";
import { CACHED_COMMUNITY_GUILD_ID } from "../utils.ts";
Deno.test({
name: "[channel] create a new voice channel with a bitrate",
ignore: Deno.env.get("TEST_ENV") === "UNIT",
async fn(t) {
const bot = loadBot();
const channel = await bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, {
name: "discordeno-test",
type: ChannelTypes.GuildVoice,
bitrate: 32000,
});
// Assertions
assertExists(channel);
assertEquals(channel.type, ChannelTypes.GuildVoice);
assertEquals(channel.topic, undefined);
assertEquals(channel.bitrate, 32000);
assertEquals(channel.userLimit, 0);
assertEquals(channel.rateLimitPerUser, 0);
assertEquals(channel.nsfw, false);
assertEquals(channel.permissionOverwrites.length, 0);
// Delete the channel once test is done
await bot.helpers.deleteChannel(channel.id);
},
});