Run server on different port when running tests

This commit is contained in:
2025-06-16 22:41:29 -07:00
parent 6084c54e2e
commit e9bfecace9
8 changed files with 32 additions and 27 deletions

View File

@@ -12,7 +12,7 @@ beforeAll(async () => {
});
it('loads the page', async () => {
await driver.get("http://localhost:8080");
await driver.get("http://localhost:3005");
expect(await driver.getTitle()).toEqual('Infantry Combat Solo Basic');
});

View File

@@ -2,20 +2,12 @@ console.log("\nSpawning server process...");
const { spawn } = require("child_process");
module.exports = async function () {
const child = spawn("node", ["dev-server.cjs"]);
const child = spawn("node", ["dev-server.cjs", "--test"]);
child.stdout.on('data', (data) => {
console.log(`${data}`);
});
// child.stderr.on('data', (data) => {
// console.error(`stderr: ${data}`);
// });
// child.on('close', (code) => {
// console.log(`child process exited with code ${code}`);
// });
globalThis.__INTEG_TEST_SERVER_PID__ = child.pid;
child.stderr.on("data", (data) => {