From 499adf993ba8a2d0a8932f69d5f20a74ea92cf90 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Thu, 29 Oct 2026 09:04:38 +0000 Subject: [PATCH] test(mcp): assert bundle path issues by field compare_bundles reports each relative path as an invalid_format issue instead of one joined diagnostic sentence. --- tests/boundary/cli/bundleComparisonCli.test.ts | 16 ++++++++++------ tests/boundary/mcp/bundleComparisonMcp.test.ts | 16 +++++++++++----- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/tests/boundary/cli/bundleComparisonCli.test.ts b/tests/boundary/cli/bundleComparisonCli.test.ts index f5b97810ab..73a2092779 100644 --- a/tests/boundary/cli/bundleComparisonCli.test.ts +++ b/tests/boundary/cli/bundleComparisonCli.test.ts @@ -12,6 +12,7 @@ import { createEvidenceBundle, serializeEvidenceBundle, } from "../../../src/domain/evidenceBundle.js"; +import { parseMcpToolError } from "../../fixtures/mcpToolError.js"; import { createTestTempDirectory } from "../../fixtures/temporaryDirectory.js"; import { cliTest } from "../../support/cli/cliFixture.js"; @@ -219,12 +220,15 @@ cliTest( name: "compare_bundles", arguments: { left_bundle_path: left, right_bundle_path: right }, }); - expect(result.isError).toBe(true); - expect(result.content[0]).toMatchObject({ - text: expect.stringContaining( - `${rejectedField}: must be an absolute local filesystem path`, - ), - }); + expect(parseMcpToolError(result).error.details?.issues).toEqual( + expect.arrayContaining([ + expect.objectContaining({ + path: [rejectedField], + reason: "invalid_format", + message: "must be an absolute local filesystem path", + }), + ]), + ); } const absolute = await client.callTool({ diff --git a/tests/boundary/mcp/bundleComparisonMcp.test.ts b/tests/boundary/mcp/bundleComparisonMcp.test.ts index b80c9ccd9c..5ecb6745d8 100644 --- a/tests/boundary/mcp/bundleComparisonMcp.test.ts +++ b/tests/boundary/mcp/bundleComparisonMcp.test.ts @@ -164,11 +164,17 @@ it("requires absolute bundle paths without changing server-cwd semantics", async expect(parseMcpToolError(result).error).toMatchObject({ code: "invalid_request", category: "invalid_input", - }); - expect(result.content[0]).toMatchObject({ - text: expect.stringContaining( - `${rejectedField}: must be an absolute local filesystem path`, - ), + details: { + operation: "compare_bundles", + issues: expect.arrayContaining([ + { + path: [rejectedField], + reason: "invalid_format", + expected: "regex", + message: "must be an absolute local filesystem path", + }, + ]), + }, }); } expect(