
















@@ -107,25 +107,15 @@ describe("diagnostic stability bundles", () => {
107107const bundle = readBundle(file);
108108const raw = fs.readFileSync(file, "utf8");
109109110-expect(bundle).toMatchObject({
111-version: 1,
112-generatedAt: "2026-04-22T12:00:00.000Z",
113-reason: "gateway.restart_startup_failed",
114-error: {
115-name: "Error",
116-code: "ERR_TEST",
117-},
118-host: {
119-hostname: "<redacted-hostname>",
120-},
121-snapshot: {
122-count: 2,
123-},
124-});
125-expect(bundle.snapshot.events[0]).toMatchObject({
126-type: "webhook.error",
127-channel: "telegram",
128-});
110+expect(bundle.version).toBe(1);
111+expect(bundle.generatedAt).toBe("2026-04-22T12:00:00.000Z");
112+expect(bundle.reason).toBe("gateway.restart_startup_failed");
113+expect(bundle.error?.name).toBe("Error");
114+expect(bundle.error?.code).toBe("ERR_TEST");
115+expect(bundle.host.hostname).toBe("<redacted-hostname>");
116+expect(bundle.snapshot.count).toBe(2);
117+expect(bundle.snapshot.events[0]?.type).toBe("webhook.error");
118+expect(bundle.snapshot.events[0]?.channel).toBe("telegram");
129119expect(bundle.snapshot.events[0]).not.toHaveProperty("chatId");
130120expect(bundle.snapshot.events[0]).not.toHaveProperty("error");
131121expect(bundle.error?.message).toContain("google/web-search-contract-api.js");
@@ -161,18 +151,14 @@ describe("diagnostic stability bundles", () => {
161151}
162152const bundle = readBundle(result.path);
163153const raw = fs.readFileSync(result.path, "utf8");
164-expect(bundle).toMatchObject({
165-reason: "gateway.restart_startup_failed",
166-error: {
167-name: "Error",
168-code: "ERR_CONFIG_PARSE",
169-message: "raw startup config payload",
170-},
171-snapshot: {
172-count: 0,
173-events: [],
174-},
154+expect(bundle.reason).toBe("gateway.restart_startup_failed");
155+expect(bundle.error).toEqual({
156+name: "Error",
157+code: "ERR_CONFIG_PARSE",
158+message: "raw startup config payload",
175159});
160+expect(bundle.snapshot.count).toBe(0);
161+expect(bundle.snapshot.events).toEqual([]);
176162expect(raw).not.toContain("stack");
177163});
178164此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。