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!
This commit is contained in:
commit
22dc79b2a4
1 changed files with 9 additions and 2 deletions
|
|
@ -1,10 +1,17 @@
|
|||
import { JSONRPCMessage } from "../types.js";
|
||||
import { StdioClientTransport, StdioServerParameters } from "./stdio.js";
|
||||
|
||||
const serverParameters: StdioServerParameters = {
|
||||
command: "/usr/bin/tee",
|
||||
// Configure default server parameters based on OS
|
||||
// Uses 'more' command for Windows and 'tee' command for Unix/Linux
|
||||
const getDefaultServerParameters = (): StdioServerParameters => {
|
||||
if (process.platform === "win32") {
|
||||
return { command: "more" };
|
||||
}
|
||||
return { command: "/usr/bin/tee" };
|
||||
};
|
||||
|
||||
const serverParameters = getDefaultServerParameters();
|
||||
|
||||
test("should start then close cleanly", async () => {
|
||||
const client = new StdioClientTransport(serverParameters);
|
||||
client.onerror = (error) => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue