Skip to content

Commit 6c3e17a

Browse files
committed
chore: fix MongoDB tests
1 parent 80258d4 commit 6c3e17a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

tests/integration/elicitation.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ describe("Elicitation Integration Tests", () => {
228228
expect(mockElicitInput.mock).toHaveBeenCalledTimes(1);
229229
});
230230

231-
it("should not request confirmation when tool is removed from confirmationRequiredTools", async () => {
231+
it("should not request confirmation when tool is removed from default confirmationRequiredTools", async () => {
232232
const result = await integration.mcpClient().callTool({
233233
name: "drop-database",
234234
arguments: { database: "test-db" },

tests/integration/tools/mongodb/mongodbTool.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import { defaultTestConfig } from "../../helpers.js";
1818
import { setupMongoDBIntegrationTest } from "./mongodbHelpers.js";
1919
import { ErrorCodes } from "../../../../src/common/errors.js";
2020
import { Keychain } from "../../../../src/common/keychain.js";
21+
import { Elicitation } from "../../../../src/elicitation.js";
2122

2223
const injectedErrorHandler: ConnectionErrorHandler = (error) => {
2324
switch (error.code) {
@@ -123,7 +124,14 @@ describe("MongoDBTool implementations", () => {
123124
connectionErrorHandler: errorHandler,
124125
});
125126

126-
tool = new RandomTool(session, userConfig, telemetry);
127+
const elicitation = new Elicitation({ server: mcpServer.server });
128+
129+
tool = new RandomTool({
130+
session,
131+
config: userConfig,
132+
telemetry,
133+
elicitation,
134+
});
127135
tool.register(mcpServer);
128136

129137
await mcpServer.connect(serverTransport);

0 commit comments

Comments
 (0)