test(mcp): share keyless bundle root expectations (#17038)

This commit is contained in:
Vincent Koc authored and GitHub committed 2026-12-05 18:55:26 +08:00
1 parent 1431b4682e
commit cd166fa5d0
1 file changed
+11 -25
+11 -25
View File
@@ -253,6 +253,12 @@ it("exposes the production resource session through the MCP SDK for a keyless bu
const { client, session, alias, canonical } =
await createResourceMcpFixture();
const expectedResourceRoot = () => ({
caller_path: alias,
canonical_path: canonical,
executable_sha256: null,
});
const opened = await client.callTool({
name: "open_bundle_resources",
arguments: { path: alias },
@@ -263,11 +269,7 @@ it("exposes the production resource session through the MCP SDK for a keyless bu
opened.structuredContent,
),
).toMatchObject({
result: {
caller_path: alias,
canonical_path: canonical,
executable_sha256: null,
},
result: expectedResourceRoot(),
});
const decoded = await client.callTool({
@@ -282,11 +284,7 @@ it("exposes the production resource session through the MCP SDK for a keyless bu
subject: UNOBSERVED_SUBJECT,
normalized_result: {
target_sha256: null,
resource_root: {
caller_path: alias,
canonical_path: canonical,
executable_sha256: null,
},
resource_root: expectedResourceRoot(),
},
});
expect(decodedEvidence.parameters).toEqual({});
@@ -322,11 +320,7 @@ it("exposes the production resource session through the MCP SDK for a keyless bu
).toMatchObject({
normalized_result: {
artifact: { path: canonical, sha256: null },
resource_root: {
caller_path: alias,
canonical_path: canonical,
executable_sha256: null,
},
resource_root: expectedResourceRoot(),
},
});
}
@@ -344,11 +338,7 @@ it("exposes the production resource session through the MCP SDK for a keyless bu
normalized_result: {
archive_path: "Resources/Archive.plist",
target_sha256: null,
resource_root: {
caller_path: alias,
canonical_path: canonical,
executable_sha256: null,
},
resource_root: expectedResourceRoot(),
objects: expect.arrayContaining([
expect.objectContaining({ value: "resource-only-value" }),
]),
@@ -367,11 +357,7 @@ it("exposes the production resource session through the MCP SDK for a keyless bu
subject: UNOBSERVED_SUBJECT,
operation: "inspect_keyed_archive",
normalized_result: {
resource_root: {
caller_path: alias,
canonical_path: canonical,
executable_sha256: null,
},
resource_root: expectedResourceRoot(),
},
});
const closed = await client.callTool({ name: "close_binary", arguments: {} });