From e5dbdca65c30ea1eb8b1cea66e819362738420ca Mon Sep 17 00:00:00 2001 From: cliffhall Date: Wed, 1 Jul 2026 19:12:44 -0400 Subject: [PATCH] test(test-servers): export MCP_APP_DEMO_URI, dedupe in integration test Address code-review DRY note on PR #1587: MCP_APP_DEMO_URI was defined in both the fixture and the integration test. Export it from the fixture and import it in the test so the two stay in lockstep. Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX --- clients/web/src/test/integration/mcp/mcp-app-demo.test.ts | 3 +-- test-servers/src/test-server-fixtures.ts | 3 ++- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/clients/web/src/test/integration/mcp/mcp-app-demo.test.ts b/clients/web/src/test/integration/mcp/mcp-app-demo.test.ts index 4da5d92c..298dd43d 100644 --- a/clients/web/src/test/integration/mcp/mcp-app-demo.test.ts +++ b/clients/web/src/test/integration/mcp/mcp-app-demo.test.ts @@ -7,11 +7,10 @@ import { createTestServerInfo, createMcpAppDemoTool, createMcpAppDemoResource, + MCP_APP_DEMO_URI, } from "@modelcontextprotocol/inspector-test-server"; import type { Tool } from "@modelcontextprotocol/sdk/types.js"; -const MCP_APP_DEMO_URI = "ui://demo/widget.html"; - /** * Exercises the `mcp_app_demo` preset added in #1557 end-to-end: it confirms the * `_meta` plumbing through the composable test server's tool/resource diff --git a/test-servers/src/test-server-fixtures.ts b/test-servers/src/test-server-fixtures.ts index 80874b28..fe52bc28 100644 --- a/test-servers/src/test-server-fixtures.ts +++ b/test-servers/src/test-server-fixtures.ts @@ -754,7 +754,8 @@ export function createArgsPrompt( }; } -const MCP_APP_DEMO_URI = "ui://demo/widget.html"; +/** Canonical URI for the {@link createMcpAppDemoResource} UI resource, referenced by {@link createMcpAppDemoTool}'s `_meta.ui.resourceUri`. Exported so tests can assert against it without redefining the literal. */ +export const MCP_APP_DEMO_URI = "ui://demo/widget.html"; /** * Minimal MCP App widget that exercises the host-side UI protocol surface