mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-08 09:11:26 +00:00
fix(gateway): unify listen startup log across bind hosts
This commit is contained in:
@@ -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})`,
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user