Files
discordeno/tests/ws/ws_close.ts
T
2021-04-09 14:41:31 +00:00

17 lines
441 B
TypeScript

import { delay, ws } 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,
});