From be21d5cd43cf007ae94d7a40cdfcd2fdd4ad2b23 Mon Sep 17 00:00:00 2001 From: Nate Date: Sat, 9 Aug 2025 11:41:01 -0400 Subject: [PATCH] fix: windows test failure --- src/tools/runTerminalCommand.test.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/tools/runTerminalCommand.test.ts b/src/tools/runTerminalCommand.test.ts index 9266000aa..7b037c802 100644 --- a/src/tools/runTerminalCommand.test.ts +++ b/src/tools/runTerminalCommand.test.ts @@ -22,10 +22,18 @@ describe("runTerminalCommandTool", () => { expect(result.trim()).toMatch(/^\/.*$/); // Should be an absolute path }); - it("should execute ls command and return file listings", async () => { - const result = await runTerminalCommandTool.run({ command: "ls -la ." }); - expect(result).toContain("."); - expect(result).toContain(".."); + it("should execute directory listing command and return file listings", async () => { + // Use a cross-platform command that works on both Unix and Windows + const command = process.platform === 'win32' ? 'dir' : 'ls -la .'; + const result = await runTerminalCommandTool.run({ command }); + + // On Windows, look for entries, on Unix look for . and .. + if (process.platform === 'win32') { + expect(result).toContain("."); + } else { + expect(result).toContain("."); + expect(result).toContain(".."); + } }); it("should handle commands with multiple arguments", async () => {