Skip to content

Commit c15d5d4

Browse files
committed
simplify test setup in connect.test.ts
1 parent 696c7f8 commit c15d5d4

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

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

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ describe("Connect tool", () => {
1414
cluster = await runMongoDB();
1515
}, 60_000);
1616

17+
beforeEach(async () => {
18+
({ client, teardown: serverClientTeardown } = await setupIntegrationTest());
19+
});
20+
1721
afterEach(async () => {
1822
await serverClientTeardown?.();
1923
});
@@ -23,10 +27,6 @@ describe("Connect tool", () => {
2327
});
2428

2529
describe("with default config", () => {
26-
beforeEach(async () => {
27-
({ client, teardown: serverClientTeardown } = await setupIntegrationTest());
28-
});
29-
3030
it("should have correct metadata", async () => {
3131
const tools = await client.listTools();
3232
const connectTool = tools.tools.find((tool) => tool.name === "connect");
@@ -84,8 +84,6 @@ describe("Connect tool", () => {
8484
describe("with connection string in config", () => {
8585
beforeEach(async () => {
8686
config.connectionString = cluster.connectionString;
87-
88-
({ client, teardown: serverClientTeardown } = await setupIntegrationTest());
8987
});
9088

9189
it("uses the connection string from config", async () => {

0 commit comments

Comments
 (0)