mirror of
https://github.com/spacebarchat/server.git
synced 2024-11-21 18:02:33 +01:00
* add TOKEN and ITER env vars to identify test script
* kill child process server when tests are done, not just parent
This commit is contained in:
parent
c723a084dc
commit
24ec642d49
@ -4,9 +4,8 @@ require("dotenv").config();
|
||||
const { OPCODES } = require("../../dist/gateway/util/Constants.js");
|
||||
const WebSocket = require("ws");
|
||||
const ENDPOINT = `ws://localhost:3002?v=9&encoding=json`;
|
||||
const TOKEN =
|
||||
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjEwOTMxMTgwMjgzNjA1MzYxMDYiLCJpYXQiOjE2ODA2OTE5MDB9.9ByCqDvC4mIutW8nM7WhVCtGuKW08UimPnmBeNw-K0E";
|
||||
const TOTAL_ITERATIONS = 500;
|
||||
const TOKEN = process.env.TOKEN;
|
||||
const TOTAL_ITERATIONS = process.env.ITER ? parseInt(process.env.ITER) : 500;
|
||||
|
||||
const doTimedIdentify = () =>
|
||||
new Promise((resolve) => {
|
||||
|
@ -34,6 +34,7 @@ server.stdout.on("data", (data) => {
|
||||
if (data.toString().toLowerCase().includes("listening")) {
|
||||
// we good :)
|
||||
console.log("we good");
|
||||
server.kill();
|
||||
process.exit();
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user