fix(mac): keep pnpm health output json-safe

This commit is contained in:
Peter Steinberger
2025-12-07 15:09:26 +00:00
parent 4e2fb38d62
commit f878e5e635
3 changed files with 21 additions and 4 deletions

View File

@@ -54,7 +54,20 @@ import Testing
let cmd = CommandResolver.clawdisCommand(subcommand: "rpc")
#expect(cmd.prefix(3).elementsEqual([pnpmPath.path, "clawdis", "rpc"]))
#expect(cmd.prefix(4).elementsEqual([pnpmPath.path, "--silent", "clawdis", "rpc"]))
}
@Test func pnpmKeepsExtraArgsAfterSubcommand() async throws {
let tmp = try makeTempDir()
CommandResolver.setProjectRoot(tmp.path)
let pnpmPath = tmp.appendingPathComponent("node_modules/.bin/pnpm")
try makeExec(at: pnpmPath)
let cmd = CommandResolver.clawdisCommand(subcommand: "health", extraArgs: ["--json", "--timeout", "5"])
#expect(cmd.prefix(5).elementsEqual([pnpmPath.path, "--silent", "clawdis", "health", "--json"]))
#expect(cmd.suffix(2).elementsEqual(["--timeout", "5"]))
}
@Test func preferredPathsStartWithProjectNodeBins() async throws {