mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-11 00:14:34 +00:00
fix(telegram): Log bound port if ephemeral (0) is configured
This commit is contained in:
@@ -304,6 +304,7 @@ describe("startTelegramWebhook", () => {
|
||||
|
||||
it("registers webhook using the bound listening port when port is 0", async () => {
|
||||
setWebhookSpy.mockClear();
|
||||
const runtimeLog = vi.fn();
|
||||
const abort = new AbortController();
|
||||
const { server } = await startTelegramWebhook({
|
||||
token: "tok",
|
||||
@@ -311,6 +312,7 @@ describe("startTelegramWebhook", () => {
|
||||
port: 0,
|
||||
abortSignal: abort.signal,
|
||||
path: "/hook",
|
||||
runtime: { log: runtimeLog, error: vi.fn(), exit: vi.fn() },
|
||||
});
|
||||
try {
|
||||
const addr = server.address();
|
||||
@@ -325,6 +327,9 @@ describe("startTelegramWebhook", () => {
|
||||
secret_token: "secret",
|
||||
}),
|
||||
);
|
||||
expect(runtimeLog).toHaveBeenCalledWith(
|
||||
`webhook local listener on http://127.0.0.1:${addr.port}/hook`,
|
||||
);
|
||||
} finally {
|
||||
abort.abort();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user