






















@@ -514,8 +514,8 @@ describe("getHealthSnapshot", () => {
514514expect(telegram.probe?.ok).toBe(true);
515515expect(telegram.probe?.bot?.username).toBe("bot");
516516expect(telegram.probe?.webhook?.url).toMatch(/^https:/);
517-expect(calls).toEqual(expect.arrayContaining([expect.stringContaining("/getMe")]));
518-expect(calls).toEqual(expect.arrayContaining([expect.stringContaining("/getWebhookInfo")]));
517+expect(calls.some((call) => call.includes("/getMe"))).toBe(true);
518+expect(calls.some((call) => call.includes("/getWebhookInfo"))).toBe(true);
519519520520const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), "openclaw-health-"));
521521const tokenFile = path.join(tmpDir, "telegram-token");
@@ -527,9 +527,7 @@ describe("getHealthSnapshot", () => {
527527);
528528expect(tokenFileProbe.telegram.configured).toBe(true);
529529expect(tokenFileProbe.telegram.probe?.ok).toBe(true);
530-expect(tokenFileProbe.calls).toEqual(
531-expect.arrayContaining([expect.stringContaining("bott-file/getMe")]),
532-);
530+expect(tokenFileProbe.calls.some((call) => call.includes("bott-file/getMe"))).toBe(true);
533531} finally {
534532fs.rmSync(tmpDir, { recursive: true, force: true });
535533}
@@ -625,13 +623,11 @@ describe("getHealthSnapshot", () => {
625623expect(discord.connected).toBe(true);
626624expect(discord.tokenSource).toBe("config");
627625expect(discord.tokenStatus).toBe("available");
628-expect(discord.accounts?.default).toMatchObject({
629-configured: true,
630-running: true,
631-connected: true,
632-tokenSource: "config",
633-tokenStatus: "available",
634-});
626+expect(discord.accounts?.default?.configured).toBe(true);
627+expect(discord.accounts?.default?.running).toBe(true);
628+expect(discord.accounts?.default?.connected).toBe(true);
629+expect(discord.accounts?.default?.tokenSource).toBe("config");
630+expect(discord.accounts?.default?.tokenStatus).toBe("available");
635631});
636632637633it("preserves plugin-derived configured state for unavailable SecretRef credentials", async () => {
@@ -680,11 +676,9 @@ describe("getHealthSnapshot", () => {
680676expect(discord.configured).toBe(true);
681677expect(discord.tokenSource).toBe("config");
682678expect(discord.tokenStatus).toBe("configured_unavailable");
683-expect(discord.accounts?.default).toMatchObject({
684-configured: true,
685-tokenSource: "config",
686-tokenStatus: "configured_unavailable",
687-});
679+expect(discord.accounts?.default?.configured).toBe(true);
680+expect(discord.accounts?.default?.tokenSource).toBe("config");
681+expect(discord.accounts?.default?.tokenStatus).toBe("configured_unavailable");
688682});
689683690684it("omits secret runtime fields and raw probe payloads from non-sensitive health snapshots", async () => {
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。