Skip to content

Commit 409e01f

Browse files
committed
separate test teardown more cleanly
1 parent 7b35cae commit 409e01f

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/integration/helpers.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { InMemoryTransport } from "./inMemoryTransport.js";
33
import { Server } from "../../src/server.js";
44
import { ObjectId } from "mongodb";
55
import { config, UserConfig } from "../../src/config.js";
6-
import { McpError, ToolListChangedNotificationSchema } from "@modelcontextprotocol/sdk/types.js";
6+
import { McpError } from "@modelcontextprotocol/sdk/types.js";
77
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
88
import { Session } from "../../src/session.js";
99
import { toIncludeAllMembers } from "jest-extended";
@@ -78,7 +78,6 @@ export function setupIntegrationTest(userConfigGetter: () => UserConfig = () =>
7878
afterEach(async () => {
7979
if (mcpServer) {
8080
await mcpServer.session.close();
81-
mcpServer.userConfig.connectionString = undefined;
8281
}
8382
});
8483

tests/integration/tools/mongodb/mongodbHelpers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export function describeWithMongoDB(
2020
const mdbIntegration = setupMongoDBIntegrationTest();
2121
const integration = setupIntegrationTest(() => userConfigGetter(mdbIntegration));
2222

23+
afterEach(() => {
24+
integration.mcpServer().userConfig.connectionString = undefined;
25+
});
26+
2327
fn({
2428
...integration,
2529
...mdbIntegration,

0 commit comments

Comments
 (0)