fix: fix misc windows issues (#323)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-19 14:01:03 -08:00
committed by GitHub
parent 66c4842375
commit e5281fb06d
12 changed files with 371 additions and 11 deletions

View File

@@ -0,0 +1,35 @@
import { describe, expect, test } from "bun:test";
// Test the Windows shell notes logic directly
// The actual sessionContext.ts uses platform() which we can't easily mock,
// but we can test that the Windows notes content is correct
describe("Session Context Windows Notes", () => {
const windowsShellNotes = `
## Windows Shell Notes
- The Bash tool uses PowerShell or cmd.exe on Windows
- HEREDOC syntax (e.g., \`$(cat <<'EOF'...EOF)\`) does NOT work on Windows
- For multiline strings (git commits, PR bodies), use simple quoted strings instead
`;
test("Windows shell notes contain heredoc warning", () => {
expect(windowsShellNotes).toContain("HEREDOC");
expect(windowsShellNotes).toContain("does NOT work on Windows");
});
test("Windows shell notes mention PowerShell", () => {
expect(windowsShellNotes).toContain("PowerShell");
});
test("Windows shell notes provide alternative for multiline strings", () => {
expect(windowsShellNotes).toContain("simple quoted strings");
});
if (process.platform === "win32") {
test("running on Windows - notes should be relevant", () => {
// This test only runs on Windows CI
// Confirms we're actually testing on Windows
expect(process.platform).toBe("win32");
});
}
});