dx: test-with-server now checks the server is not already running

Massimo Melina committed Jan 16, 2026 at 14:24 UTC 20235c4f49da18f3d5bb460b13abfa83a6849409
1 file changed +2 -1
package.json
+2 -1
@@ -20,7 +20,8 @@
20 "server-for-test": "node dist/src --cwd tests/work --config tests --debug",
21 "server-for-test-dev": "cross-env DEV=1 FRONTEND_PROXY=3005 ADMIN_PROXY=3006 nodemon --ignore tests/ --watch src -e ts,tsx --exec tsx src -- --cwd tests/work --config tests",
22 "test": "node --import tsx --test tests/test.ts",
23 - "test-with-server": "tsc && rm -rf tests/work && (node dist/src --cwd tests/work --config tests & echo $! > .server_pid) && sleep 2 && node --import tsx --test tests/test.ts; _exit=$?; SERVER_PID=$(cat ./.server_pid); kill \"$SERVER_PID\" 2>/dev/null || true; rm -f ./.server_pid; exit $_exit",
23 + "test-with-server": "npm run port-is-free && tsc && rm -rf tests/work && (node dist/src --cwd tests/work --config tests & echo $! > .server_pid) && sleep 2 && node --import tsx --test tests/test.ts; _exit=$?; if [ -f ./.server_pid ]; then SERVER_PID=$(cat ./.server_pid); kill \"$SERVER_PID\" 2>/dev/null || true; rm -f ./.server_pid; fi; exit $_exit",
24 + "port-is-free": "node -e \"process.exit(await fetch('http://localhost:81').then(() => console.log('BUSY') || 1, () => 0))\"",
25 "test-ui": "npx playwright test frontend && npx playwright test serial",
26 "test-with-ui": "npx playwright test --ui",
27 "pub": "cd dist && npm publish",