npm run format
This commit is contained in:
parent
a2b62aafc6
commit
6e72c496c7
2 changed files with 14 additions and 8 deletions
|
|
@ -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", () => {
|
|||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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", () => {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue