From 025cf43f248c342cfaec0ceed14ef9c2dc268382 Mon Sep 17 00:00:00 2001 From: ework-agent Date: Sun, 4 Oct 2026 17:46:57 +0800 Subject: [PATCH] test(update): pin describeInstallLocation fixture to a resolved tmpdir path (#2068) --- tests/update-install-dir.test.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/update-install-dir.test.ts b/tests/update-install-dir.test.ts index 481ad79f5c..c34a2e8142 100644 --- a/tests/update-install-dir.test.ts +++ b/tests/update-install-dir.test.ts @@ -117,7 +117,10 @@ test("findInstallDir: resolves this running copy's own root", async () => { }); test("describeInstallLocation: names target, symlink real, and running module", async () => { - const base = mkdtempSync(path.join(tmpdir(), "bc-installdir-")); + // Resolve the tmpdir up front: on macOS tmpdir() is itself a symlink + // (/var -> /private/var), so an unresolved fixture would make + // describeInstallLocation emit real= for the "plain" case too (#2068). + const base = realpathSync(mkdtempSync(path.join(tmpdir(), "bc-installdir-"))); try { const real = path.join(base, "global", "node_modules", PKG); writePkg(real, { name: PKG, version: "0.1.129" });