





















@@ -95,8 +95,23 @@ describe("statusJsonCommand", () => {
9595await statusJsonCommand({}, runtime);
96969797expect(mocks.runSecurityAudit).not.toHaveBeenCalled();
98-expect(logs).toHaveLength(1);
99-expect(JSON.parse(logs[0] ?? "{}")).not.toHaveProperty("securityAudit");
98+expect(logs).toStrictEqual([expect.any(String)]);
99+const payload = JSON.parse(logs[0] ?? "{}") as Record<string, unknown>;
100+expect(payload).toMatchObject({
101+ok: true,
102+configuredChannels: [],
103+os: { platform: "linux" },
104+update: { installKind: "npm", git: { tag: null, branch: null } },
105+updateChannel: "stable",
106+updateChannelSource: "config",
107+memory: null,
108+memoryPlugin: null,
109+gatewayService: { installed: false },
110+nodeService: { installed: false },
111+agents: [],
112+secretDiagnostics: [],
113+});
114+expect(payload).not.toHaveProperty("securityAudit");
100115});
101116102117it("includes security audit details only when --all is requested", async () => {
@@ -130,7 +145,14 @@ describe("statusJsonCommand", () => {
130145"telegram",
131146"whatsapp",
132147]);
133-expect(logs).toHaveLength(1);
134-expect(JSON.parse(logs[0] ?? "{}")).toHaveProperty("securityAudit.summary.critical", 1);
148+expect(logs).toStrictEqual([expect.any(String)]);
149+const payload = JSON.parse(logs[0] ?? "{}") as Record<string, unknown>;
150+expect(payload).toMatchObject({
151+ok: true,
152+securityAudit: {
153+summary: { critical: 1, warn: 0, info: 0 },
154+findings: [],
155+},
156+});
135157});
136158});
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。