diff --git a/core/config/yaml/loadYaml.cwd.vitest.ts b/core/config/yaml/loadYaml.cwd.vitest.ts index 2b7e3ee61..fd6769f70 100644 --- a/core/config/yaml/loadYaml.cwd.vitest.ts +++ b/core/config/yaml/loadYaml.cwd.vitest.ts @@ -1,10 +1,13 @@ import { describe, it, expect } from "vitest"; -import { validateConfigYaml, AssistantUnrolled } from "@continuedev/config-yaml"; +import { + validateConfigYaml, + AssistantUnrolledNonNullable, +} from "@continuedev/config-yaml"; describe("MCP Server cwd configuration", () => { describe("YAML schema validation", () => { it("should accept valid MCP server with cwd", () => { - const config: AssistantUnrolled = { + const config: AssistantUnrolledNonNullable = { name: "test-assistant", version: "1.0.0", mcpServers: [ @@ -24,7 +27,7 @@ describe("MCP Server cwd configuration", () => { }); it("should accept MCP server without cwd", () => { - const config: AssistantUnrolled = { + const config: AssistantUnrolledNonNullable = { name: "test-assistant", version: "1.0.0", mcpServers: [ @@ -41,7 +44,7 @@ describe("MCP Server cwd configuration", () => { }); it("should accept relative paths in cwd", () => { - const config: AssistantUnrolled = { + const config: AssistantUnrolledNonNullable = { name: "test-assistant", version: "1.0.0", mcpServers: [ @@ -59,7 +62,7 @@ describe("MCP Server cwd configuration", () => { }); it("should accept empty string cwd", () => { - const config: AssistantUnrolled = { + const config: AssistantUnrolledNonNullable = { name: "test-assistant", version: "1.0.0", mcpServers: [ @@ -111,7 +114,7 @@ describe("MCP Server cwd configuration", () => { ]; configs.forEach(({ name, server }) => { - const config: AssistantUnrolled = { + const config: AssistantUnrolledNonNullable = { name: "test-assistant", version: "1.0.0", mcpServers: [server], @@ -122,4 +125,4 @@ describe("MCP Server cwd configuration", () => { }); }); }); -}); \ No newline at end of file +}); diff --git a/core/context/mcp/MCPConnection.test.ts b/core/context/mcp/MCPConnection.test.ts index 84fb1a703..fb9def814 100644 --- a/core/context/mcp/MCPConnection.test.ts +++ b/core/context/mcp/MCPConnection.test.ts @@ -1,6 +1,7 @@ import { jest } from "@jest/globals"; import { Client } from "@modelcontextprotocol/sdk/client/index.js"; import MCPConnection from "./MCPConnection"; +import { StdioOptions } from "../../index.d.js"; describe("MCPConnection", () => { beforeEach(() => { @@ -41,7 +42,9 @@ describe("MCPConnection", () => { const conn = new MCPConnection(options); expect(conn).toBeInstanceOf(MCPConnection); expect(conn.status).toBe("not-connected"); - expect(conn.options.transport.cwd).toBe("/path/to/working/directory"); + if (conn.options.transport.type === "stdio") { + expect(conn.options.transport.cwd).toBe("/path/to/working/directory"); + } }); it("should create instance with websocket transport", () => {