fix(gateway): unify listen startup log across bind hosts

This commit is contained in:
Peter Steinberger
2026-02-22 13:17:14 +01:00
parent 51e9c54f09
commit bcad4f67a2
2 changed files with 23 additions and 7 deletions

View File

@@ -42,4 +42,25 @@ describe("gateway startup log", () => {
expect(warn).not.toHaveBeenCalled();
});
it("logs all listen endpoints on a single line", () => {
const info = vi.fn();
const warn = vi.fn();
logGatewayStartup({
cfg: {},
bindHost: "127.0.0.1",
bindHosts: ["127.0.0.1", "::1"],
port: 18789,
log: { info, warn },
isNixMode: false,
});
const listenMessages = info.mock.calls
.map((call) => call[0])
.filter((message) => message.startsWith("listening on "));
expect(listenMessages).toEqual([
`listening on ws://127.0.0.1:18789, ws://[::1]:18789 (PID ${process.pid})`,
]);
});
});