fix: delete channels in tests

This commit is contained in:
Skillz4Killz
2022-05-10 14:48:14 +00:00
committed by GitHub
parent ba9944c6b0
commit c996a56ad5
2 changed files with 7 additions and 1 deletions
+2
View File
@@ -14,5 +14,7 @@ Deno.test({
assertExists(fetched);
assertEquals(channel.id, fetched.id);
assertEquals(channel.name, fetched.name);
await bot.helpers.deleteChannel(channel.id);
},
});
+5 -1
View File
@@ -6,7 +6,7 @@ Deno.test({
name: "[channel] Get all channels",
async fn() {
const bot = loadBot();
await Promise.all([
const [first, second] = await Promise.all([
bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, { name: "first" }),
bot.helpers.createChannel(CACHED_COMMUNITY_GUILD_ID, { name: "second" }),
]);
@@ -14,5 +14,9 @@ Deno.test({
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)],
);
},
});