mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
deno fmt
This commit is contained in:
@@ -19,7 +19,9 @@ Deno.test({
|
|||||||
await delay(5000);
|
await delay(5000);
|
||||||
|
|
||||||
if (!cache.channels.has(channel.id)) {
|
if (!cache.channels.has(channel.id)) {
|
||||||
throw new Error("The channel seemed to be created but it was not cached.");
|
throw new Error(
|
||||||
|
"The channel seemed to be created but it was not cached.",
|
||||||
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
...defaultTestOptions,
|
...defaultTestOptions,
|
||||||
|
|||||||
@@ -11,48 +11,52 @@ Deno.test({
|
|||||||
// wait 5 seconds to give it time for CHANNEL_CREATE event
|
// wait 5 seconds to give it time for CHANNEL_CREATE event
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
// Make sure the channel was created.
|
// Make sure the channel was created.
|
||||||
if (!cache.channels.has(channel.id))
|
if (!cache.channels.has(channel.id)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"The channel should have been created but it is not in the cache."
|
"The channel should have been created but it is not in the cache.",
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Delete the channel now without a reason
|
// Delete the channel now without a reason
|
||||||
await deleteChannel(tempData.guildId, channel.id);
|
await deleteChannel(tempData.guildId, channel.id);
|
||||||
// wait 5 seconds to give it time for CHANNEL_DELETE event
|
// wait 5 seconds to give it time for CHANNEL_DELETE event
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
// Make sure it is gone from cache
|
// Make sure it is gone from cache
|
||||||
if (cache.channels.has(channel.id))
|
if (cache.channels.has(channel.id)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"The channel should have been deleted but it is still in cache."
|
"The channel should have been deleted but it is still in cache.",
|
||||||
);
|
);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
...defaultTestOptions,
|
...defaultTestOptions,
|
||||||
});
|
});
|
||||||
|
|
||||||
Deno.test({
|
Deno.test({
|
||||||
name: "[channel] delete a channel with a reason.",
|
name: "[channel] delete a channel with a reason.",
|
||||||
async fn() {
|
async fn() {
|
||||||
// Create the necessary channels
|
// Create the necessary channels
|
||||||
const channel = await createChannel(tempData.guildId, {
|
const channel = await createChannel(tempData.guildId, {
|
||||||
name: "delete-channel",
|
name: "delete-channel",
|
||||||
});
|
});
|
||||||
// wait 5 seconds to give it time for CHANNEL_CREATE event
|
// wait 5 seconds to give it time for CHANNEL_CREATE event
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
// Make sure the channel was created.
|
// Make sure the channel was created.
|
||||||
if (!cache.channels.has(channel.id))
|
if (!cache.channels.has(channel.id)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"The channel should have been created but it is not in the cache."
|
"The channel should have been created but it is not in the cache.",
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Delete the channel now without a reason
|
// Delete the channel now without a reason
|
||||||
await deleteChannel(tempData.guildId, channel.id, "with a reason");
|
await deleteChannel(tempData.guildId, channel.id, "with a reason");
|
||||||
// wait 5 seconds to give it time for CHANNEL_DELETE event
|
// wait 5 seconds to give it time for CHANNEL_DELETE event
|
||||||
await delay(5000);
|
await delay(5000);
|
||||||
// Make sure it is gone from cache
|
// Make sure it is gone from cache
|
||||||
if (cache.channels.has(channel.id))
|
if (cache.channels.has(channel.id)) {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
"The channel should have been deleted but it is still in cache."
|
"The channel should have been deleted but it is still in cache.",
|
||||||
);
|
);
|
||||||
},
|
}
|
||||||
...defaultTestOptions,
|
},
|
||||||
});
|
...defaultTestOptions,
|
||||||
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user