|
1 | 1 | import { setupIntegrationTest } from "./helpers"; |
| 2 | +import { config } from "../../src/config.js"; |
2 | 3 |
|
3 | 4 | describe("Server integration test", () => { |
4 | | - const integration = setupIntegrationTest(); |
| 5 | + describe("without atlas", () => { |
| 6 | + const integration = setupIntegrationTest({ |
| 7 | + ...config, |
| 8 | + apiClientId: undefined, |
| 9 | + apiClientSecret: undefined, |
| 10 | + }); |
5 | 11 |
|
6 | | - describe("list capabilities", () => { |
7 | | - it("should return positive number of tools", async () => { |
| 12 | + it("should return positive number of tools and have no atlas tools", async () => { |
8 | 13 | const tools = await integration.mcpClient().listTools(); |
9 | 14 | expect(tools).toBeDefined(); |
10 | 15 | expect(tools.tools.length).toBeGreaterThan(0); |
| 16 | + |
| 17 | + const atlasTools = tools.tools.filter((tool) => tool.name.startsWith("atlas-")); |
| 18 | + expect(atlasTools.length).toBeLessThanOrEqual(0); |
11 | 19 | }); |
| 20 | + }); |
| 21 | + describe("with atlas", () => { |
| 22 | + const integration = setupIntegrationTest({ |
| 23 | + ...config, |
| 24 | + apiClientId: "test", |
| 25 | + apiClientSecret: "test", |
| 26 | + }); |
| 27 | + |
| 28 | + describe("list capabilities", () => { |
| 29 | + it("should return positive number of tools and have some atlas tools", async () => { |
| 30 | + const tools = await integration.mcpClient().listTools(); |
| 31 | + expect(tools).toBeDefined(); |
| 32 | + expect(tools.tools.length).toBeGreaterThan(0); |
12 | 33 |
|
13 | | - it("should return no resources", async () => { |
14 | | - await expect(() => integration.mcpClient().listResources()).rejects.toMatchObject({ |
15 | | - message: "MCP error -32601: Method not found", |
| 34 | + const atlasTools = tools.tools.filter((tool) => tool.name.startsWith("atlas-")); |
| 35 | + expect(atlasTools.length).toBeGreaterThan(0); |
16 | 36 | }); |
17 | | - }); |
18 | 37 |
|
19 | | - it("should return no prompts", async () => { |
20 | | - await expect(() => integration.mcpClient().listPrompts()).rejects.toMatchObject({ |
21 | | - message: "MCP error -32601: Method not found", |
| 38 | + it("should return no resources", async () => { |
| 39 | + await expect(() => integration.mcpClient().listResources()).rejects.toMatchObject({ |
| 40 | + message: "MCP error -32601: Method not found", |
| 41 | + }); |
22 | 42 | }); |
23 | | - }); |
24 | 43 |
|
25 | | - it("should return capabilities", async () => { |
26 | | - const capabilities = integration.mcpClient().getServerCapabilities(); |
27 | | - expect(capabilities).toBeDefined(); |
28 | | - expect(capabilities?.completions).toBeUndefined(); |
29 | | - expect(capabilities?.experimental).toBeUndefined(); |
30 | | - expect(capabilities?.tools).toBeDefined(); |
31 | | - expect(capabilities?.logging).toBeDefined(); |
32 | | - expect(capabilities?.prompts).toBeUndefined(); |
| 44 | + it("should return no prompts", async () => { |
| 45 | + await expect(() => integration.mcpClient().listPrompts()).rejects.toMatchObject({ |
| 46 | + message: "MCP error -32601: Method not found", |
| 47 | + }); |
| 48 | + }); |
| 49 | + |
| 50 | + it("should return capabilities", async () => { |
| 51 | + const capabilities = integration.mcpClient().getServerCapabilities(); |
| 52 | + expect(capabilities).toBeDefined(); |
| 53 | + expect(capabilities?.completions).toBeUndefined(); |
| 54 | + expect(capabilities?.experimental).toBeUndefined(); |
| 55 | + expect(capabilities?.tools).toBeDefined(); |
| 56 | + expect(capabilities?.logging).toBeDefined(); |
| 57 | + expect(capabilities?.prompts).toBeUndefined(); |
| 58 | + }); |
33 | 59 | }); |
34 | 60 | }); |
35 | 61 | }); |
0 commit comments