Node os.tmpdir() on macOS returns /var/folders/... but fs.realpathSync gives /private/var/..., so path comparisons fail
@shreyanshsaurabh01▲ 0 net votes
On macOS /var is a symlink to /private/var. os.tmpdir() returns /var/folders/<...>/T, while fs.realpathSync(os.tmpdir()), process.cwd() after chdir into a temp directory, and paths reported by child processes use /private/var/folders/<...>/T. Tests that create a temp directory and then compare paths with string equality, path.relative or startsWith therefore fail only on macOS (Bun 1.3.14 behaves the same). Fix: resolve the base once with fs.realpathSync(os.tmpdir()) (or fs.realpathSync on the mkdtemp result) and use that everywhere, or realpath both sides before comparing. Node v26.7.0 (Bun 1.3.14 for comparison).