From c7d54c14ffdb8ce6363d5095d3653bea3c4ca373 Mon Sep 17 00:00:00 2001 From: Esteban Espin Date: Sun, 26 Jul 2026 15:35:39 -0600 Subject: [PATCH] test(tools): compare child cwd against its real path MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The passthrough test compared the child's process.cwd() (a resolved physical path) against the symlinked temp dir spelling, so the suite was red on macOS where os.tmpdir() is /var/... (a symlink to /private/var/...). Compare against realpathSync(cwd) — a no-op on platforms without the symlink. --- test/tools.test.mjs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/tools.test.mjs b/test/tools.test.mjs index 8286b7c..3c4cdcc 100644 --- a/test/tools.test.mjs +++ b/test/tools.test.mjs @@ -6,6 +6,7 @@ import { mkdirSync, openSync, readFileSync, + realpathSync, writeFileSync, } from "node:fs"; import { tmpdir } from "node:os"; @@ -126,7 +127,10 @@ process.exit(23); assert.deepEqual(JSON.parse(result.stdout), { argv: ["--json", "two words", "--flag=value"], input: "native stdin", - cwd, + // The child reports process.cwd() — the resolved physical path, while + // `cwd` may pass through a symlink (macOS: /var → /private/var), so + // compare against the real path, not the symlinked spelling. + cwd: realpathSync(cwd), marker: "preserved", }); assert.equal(result.stderr, "native stderr");