refactor: base complete for unit tests

This commit is contained in:
Skillz4Killz
2021-04-09 12:46:38 +00:00
committed by GitHub
parent 7fa8e3a552
commit 03631e3c6e
10 changed files with 104 additions and 55 deletions
+16
View File
@@ -0,0 +1,16 @@
import { ws, delay } from "../../mod.ts";
import { defaultTestOptions } from "./start_bot.ts";
// Exit the Deno process once all tests are done.
Deno.test({
name: "[ws] Close all shards manually.",
async fn() {
ws.shards.forEach((shard) => {
clearInterval(shard.heartbeat.intervalId);
shard.ws.close(3064, "Discordeno Testing Finished! Do Not RESUME!");
});
await delay(3000);
},
...defaultTestOptions,
});