test(snapshot): assert full validation diagnostics

Refs #7442

Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com>
This commit is contained in:
morluto
2026-10-29 01:38:06 +08:00
committed by Ysopwnable
parent 213fcc8ce1
commit 4d544c8434
2 changed files with 8 additions and 0 deletions
@@ -59,6 +59,10 @@ cliTest(
});
expect(error).not.toHaveProperty("cause");
expect(error).not.toHaveProperty("stack");
if (field === "target")
expect(error.details?.reason).toBe(
"Analysis snapshot validation failed at target: Invalid input: expected object, received undefined (2 more issues)",
);
}
expect(mcpError.details).toEqual(cliError.details);
expect(await readFile(snapshot, "utf8")).toBe(encoded);
@@ -59,6 +59,10 @@ describe.each([
retryable: false,
details: { reason: expect.stringContaining(`at ${field}:`) },
});
if (field === "target")
expect(projected.details?.reason).toBe(
"Analysis snapshot validation failed at target: Invalid input: expected object, received undefined (2 more issues)",
);
expect(projected).not.toHaveProperty("cause");
expect(projected).not.toHaveProperty("stack");
expect(await readFile(path, "utf8")).toBe(encoded);