-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3f178b2
commit 7c91349
Showing
3 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Server } from "../server/index.js"; | ||
import { StdioServerTransport } from "../server/stdio.js"; | ||
|
||
describe("Process cleanup", () => { | ||
jest.setTimeout(5000); // 5 second timeout | ||
|
||
it("should exit cleanly after closing transport", async () => { | ||
const server = new Server( | ||
{ | ||
name: "test-server", | ||
version: "1.0.0", | ||
}, | ||
{ | ||
capabilities: {}, | ||
} | ||
); | ||
|
||
const transport = new StdioServerTransport(); | ||
await server.connect(transport); | ||
|
||
// Close the transport | ||
await transport.close(); | ||
|
||
// If we reach here without hanging, the test passes | ||
// The test runner will fail if the process hangs | ||
expect(true).toBe(true); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters