Skip to content

Commit 696c7f8

Browse files
committed
fix: properly teardown mocks in server.test.ts
1 parent 3909e3c commit 696c7f8

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

tests/integration/server.test.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import { Client } from "@modelcontextprotocol/sdk/client/index.js";
2-
import { Server } from "../../src/server.js";
32
import { setupIntegrationTest } from "./helpers.js";
43

54
describe("Server integration test", () => {
65
let client: Client;
7-
let server: Server;
6+
let teardown: () => Promise<void>;
87

98
beforeEach(async () => {
10-
({ client, server } = await setupIntegrationTest());
9+
({ client, teardown } = await setupIntegrationTest());
1110
});
1211

1312
afterEach(async () => {
14-
await client?.close();
15-
await server?.close();
13+
await teardown();
1614
});
1715

1816
describe("list capabilities", () => {

0 commit comments

Comments
 (0)