mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-12 02:09:42 +02:00
test: build every in-process WebServer on port 0 (#440)
The files on the guard's legacy list build new WebServer(0, …) and read server.boundPort after start(), as sse-tile-grid-filter does. Files with several servers read each server's own port; quick-start's local helper lost its port parameter so the literal 0 sits where the server is built. Header comments that named a port say "ephemeral". No assertion changed except where it embedded the port. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3a0cee6b90
commit
aa4217b8b1
@@ -9,7 +9,7 @@
|
||||
* closes sessions unattended, which turns that from an occasional loss into a
|
||||
* routine one.
|
||||
*
|
||||
* Port: 3188
|
||||
* Port: ephemeral
|
||||
*/
|
||||
import { existsSync, mkdirSync, mkdtempSync, rmSync, symlinkSync, writeFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
@@ -18,8 +18,6 @@ import { afterAll, beforeAll, describe, expect, it, vi } from 'vitest';
|
||||
import { WebServer } from '../src/web/server.js';
|
||||
import { pasteImageDirInUseByOtherSession } from '../src/web/paste-image-gc.js';
|
||||
|
||||
const PORT = 3188;
|
||||
|
||||
describe('pasteImageDirInUseByOtherSession', () => {
|
||||
const none = new Set<string>();
|
||||
const check = (
|
||||
@@ -108,12 +106,13 @@ describe('pasteImageDirInUseByOtherSession', () => {
|
||||
describe('deleting a session that shares its working directory', () => {
|
||||
let server: WebServer;
|
||||
let workingDir: string;
|
||||
const base = `http://localhost:${PORT}`;
|
||||
let base: string;
|
||||
|
||||
beforeAll(async () => {
|
||||
workingDir = mkdtempSync(join(tmpdir(), 'codeman-paste-shared-'));
|
||||
server = new WebServer(PORT, false, true);
|
||||
server = new WebServer(0, false, true);
|
||||
await server.start();
|
||||
base = `http://localhost:${server.boundPort}`;
|
||||
});
|
||||
|
||||
afterAll(async () => {
|
||||
|
||||
Reference in New Issue
Block a user