From 28315f4fc991c0960b8179c4c1c1b8b67a9f6ac2 Mon Sep 17 00:00:00 2001 From: Daniel Riccio Date: Fri, 13 Jun 2025 15:56:30 -0500 Subject: [PATCH] fix: update new mcp tests --- src/services/mcp/__tests__/McpHub.spec.ts | 39 +++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/src/services/mcp/__tests__/McpHub.spec.ts b/src/services/mcp/__tests__/McpHub.spec.ts index 902288c97e..70fc6d9b18 100644 --- a/src/services/mcp/__tests__/McpHub.spec.ts +++ b/src/services/mcp/__tests__/McpHub.spec.ts @@ -271,6 +271,19 @@ describe("McpHub", () => { }, } + // Set up mock connection + const mockConnection: McpConnection = { + server: { + name: "test-server", + config: "test-server-config", + status: "connected", + source: "global", + }, + client: {} as any, + transport: {} as any, + } + mcpHub.connections = [mockConnection] + // Mock reading initial config ;(fs.readFile as jest.Mock).mockResolvedValueOnce(JSON.stringify(mockConfig)) @@ -305,6 +318,19 @@ describe("McpHub", () => { }, } + // Set up mock connection + const mockConnection: McpConnection = { + server: { + name: "test-server", + config: "test-server-config", + status: "connected", + source: "global", + }, + client: {} as any, + transport: {} as any, + } + mcpHub.connections = [mockConnection] + // Mock reading initial config ;(fs.readFile as jest.Mock).mockResolvedValueOnce(JSON.stringify(mockConfig)) @@ -338,6 +364,19 @@ describe("McpHub", () => { }, } + // Set up mock connection + const mockConnection: McpConnection = { + server: { + name: "test-server", + config: "test-server-config", + status: "connected", + source: "global", + }, + client: {} as any, + transport: {} as any, + } + mcpHub.connections = [mockConnection] + // Mock reading initial config ;(fs.readFile as jest.Mock).mockResolvedValueOnce(JSON.stringify(mockConfig))