perf(test): remove slow port inspection and reconnect sleeps

This commit is contained in:
Peter Steinberger
2026-02-14 04:52:02 +00:00
parent 1f432ffb93
commit e6d5b5fb11
3 changed files with 46 additions and 29 deletions

View File

@@ -24,7 +24,10 @@ describe("ports helpers", () => {
log: vi.fn(),
exit: vi.fn() as unknown as (code: number) => never,
};
await handlePortError({ code: "EADDRINUSE" }, 1234, "context", runtime).catch(() => {});
// Avoid slow OS port inspection; this test only cares about messaging + exit behavior.
await handlePortError(new PortInUseError(1234, "details"), 1234, "context", runtime).catch(
() => {},
);
expect(runtime.error).toHaveBeenCalled();
expect(runtime.exit).toHaveBeenCalledWith(1);
});