fix(line): mark running after startup succeeds · openclaw/openclaw@3952ac9
vincentkoc
·
2026-06-17
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -315,6 +315,24 @@ describe("monitorLineProvider lifecycle", () => {
|
315 | 315 | monitor.stop(); |
316 | 316 | }); |
317 | 317 | |
| 318 | +it("does not record running state when bot startup fails", async () => { |
| 319 | +createLineBotMock.mockImplementation(() => { |
| 320 | +throw new Error("line bot startup failed"); |
| 321 | +}); |
| 322 | + |
| 323 | +await expect( |
| 324 | +monitorLineProvider({ |
| 325 | +channelAccessToken: "token", |
| 326 | +channelSecret: "secret", // pragma: allowlist secret |
| 327 | +config: {} as OpenClawConfig, |
| 328 | +runtime: {} as RuntimeEnv, |
| 329 | +}), |
| 330 | +).rejects.toThrow("line bot startup failed"); |
| 331 | + |
| 332 | +expect(getLineRuntimeState("default")?.running).not.toBe(true); |
| 333 | +expect(registerWebhookTargetWithPluginRouteMock).not.toHaveBeenCalled(); |
| 334 | +}); |
| 335 | + |
318 | 336 | it("dispatches shared-path webhook posts to the account matching the signature", async () => { |
319 | 337 | const firstMonitor = await monitorLineProvider({ |
320 | 338 | channelAccessToken: "first-token", |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。