From 4d544c8434f4fa4ebefae5b6785281f2ef2d2ce1 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Thu, 29 Oct 2026 01:38:06 +0800 Subject: [PATCH] test(snapshot): assert full validation diagnostics Refs #7442 Co-Authored-By: gensokyo-dev <342580529+gensokyo-dev@users.noreply.github.com> --- tests/acceptance/analysisSnapshotDiagnostics.test.ts | 4 ++++ tests/boundary/filesystem/analysisSnapshotInput.test.ts | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/acceptance/analysisSnapshotDiagnostics.test.ts b/tests/acceptance/analysisSnapshotDiagnostics.test.ts index 1c24529239..b81bc38ca7 100644 --- a/tests/acceptance/analysisSnapshotDiagnostics.test.ts +++ b/tests/acceptance/analysisSnapshotDiagnostics.test.ts @@ -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); diff --git a/tests/boundary/filesystem/analysisSnapshotInput.test.ts b/tests/boundary/filesystem/analysisSnapshotInput.test.ts index 0b5ca523f5..6f67fbf01d 100644 --- a/tests/boundary/filesystem/analysisSnapshotInput.test.ts +++ b/tests/boundary/filesystem/analysisSnapshotInput.test.ts @@ -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);