Skip to content

Commit fe92d1c

Browse files
committed
PR feedback
1 parent eaffdbe commit fe92d1c

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

tests/integration/tools/mongodb/metadata/connect.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,18 @@ describe("Connect tool", () => {
2727
});
2828

2929
it("should have correct metadata", async () => {
30-
const tools = await client.listTools();
31-
const connectTool = tools.tools.find((tool) => tool.name === "connect");
30+
const { tools } = await client.listTools();
31+
const connectTool = tools.find((tool) => tool.name === "connect")!;
3232
expect(connectTool).toBeDefined();
33-
expect(connectTool!.description).toBe("Connect to a MongoDB instance");
34-
expect(connectTool!.inputSchema.type).toBe("object");
35-
expect(connectTool!.inputSchema.properties).toBeDefined();
33+
expect(connectTool.description).toBe("Connect to a MongoDB instance");
34+
expect(connectTool.inputSchema.type).toBe("object");
35+
expect(connectTool.inputSchema.properties).toBeDefined();
3636

37-
const propertyNames = Object.keys(connectTool!.inputSchema.properties!);
37+
const propertyNames = Object.keys(connectTool.inputSchema.properties!);
3838
expect(propertyNames).toHaveLength(1);
3939
expect(propertyNames[0]).toBe("connectionStringOrClusterName");
4040

41-
const connectionStringOrClusterNameProp = connectTool!.inputSchema.properties![propertyNames[0]] as {
41+
const connectionStringOrClusterNameProp = connectTool.inputSchema.properties![propertyNames[0]] as {
4242
type: string;
4343
description: string;
4444
};

tests/integration/tools/mongodb/metadata/listDatabases.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ describe("listDatabases tool", () => {
2727
});
2828

2929
it("should have correct metadata", async () => {
30-
const tools = await client.listTools();
31-
const listDatabases = tools.tools.find((tool) => tool.name === "list-databases");
30+
const { tools } = await client.listTools();
31+
const listDatabases = tools.find((tool) => tool.name === "list-databases")!;
3232
expect(listDatabases).toBeDefined();
33-
expect(listDatabases!.description).toBe("List all databases for a MongoDB connection");
34-
expect(listDatabases!.inputSchema.type).toBe("object");
35-
expect(listDatabases!.inputSchema.properties).toBeDefined();
33+
expect(listDatabases.description).toBe("List all databases for a MongoDB connection");
34+
expect(listDatabases.inputSchema.type).toBe("object");
35+
expect(listDatabases.inputSchema.properties).toBeDefined();
3636

37-
const propertyNames = Object.keys(listDatabases!.inputSchema.properties!);
37+
const propertyNames = Object.keys(listDatabases.inputSchema.properties!);
3838
expect(propertyNames).toHaveLength(0);
3939
});
4040

0 commit comments

Comments
 (0)