Skip to content

Commit 4e8b791

Browse files
committed
test: test atlas presence
1 parent 7276731 commit 4e8b791

File tree

1 file changed

+45
-19
lines changed

1 file changed

+45
-19
lines changed

tests/integration/server.test.ts

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,61 @@
11
import { setupIntegrationTest } from "./helpers";
2+
import { config } from "../../src/config.js";
23

34
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+
});
511

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 () => {
813
const tools = await integration.mcpClient().listTools();
914
expect(tools).toBeDefined();
1015
expect(tools.tools.length).toBeGreaterThan(0);
16+
17+
const atlasTools = tools.tools.filter((tool) => tool.name.startsWith("atlas-"));
18+
expect(atlasTools.length).toBeLessThanOrEqual(0);
1119
});
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);
1233

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);
1636
});
17-
});
1837

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+
});
2242
});
23-
});
2443

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+
});
3359
});
3460
});
3561
});

0 commit comments

Comments
 (0)