Skip to content

Commit 22dc79b

Browse files
Merge pull request #284 from HoberMin/feat/improve-stdio-test-windows-compatibility
Improve stdio test Windows compatibility and refactor command logic I've pushed updates to address my own comments - thank you @HoberMin for this contribution!
2 parents 6ae4a57 + 88ede37 commit 22dc79b

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/client/stdio.test.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
11
import { JSONRPCMessage } from "../types.js";
22
import { StdioClientTransport, StdioServerParameters } from "./stdio.js";
33

4-
const serverParameters: StdioServerParameters = {
5-
command: "/usr/bin/tee",
4+
// Configure default server parameters based on OS
5+
// Uses 'more' command for Windows and 'tee' command for Unix/Linux
6+
const getDefaultServerParameters = (): StdioServerParameters => {
7+
if (process.platform === "win32") {
8+
return { command: "more" };
9+
}
10+
return { command: "/usr/bin/tee" };
611
};
712

13+
const serverParameters = getDefaultServerParameters();
14+
815
test("should start then close cleanly", async () => {
916
const client = new StdioClientTransport(serverParameters);
1017
client.onerror = (error) => {

0 commit comments

Comments
 (0)