From debff6504f74c6a1dca2d9c8634b300be34faaea Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Tue, 24 Feb 2026 00:29:20 +0100 Subject: [PATCH] fix(test): skip execPath assertion on Windows in dlx node runtime test On Windows, node.exe is hardlinked into .bin/ so process.execPath reports the hardlink path rather than the original store location. The version check already validates the correct node runtime is being used. --- pnpm/test/dlx.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pnpm/test/dlx.ts b/pnpm/test/dlx.ts index 7d7f29adc0..125092d55b 100644 --- a/pnpm/test/dlx.ts +++ b/pnpm/test/dlx.ts @@ -291,7 +291,12 @@ test('dlx uses the node version specified by --package=node@runtime:', } expect(nodeInfo.versions.node).toBe('20.0.0') - expect(nodeInfo.execPath).toContain(path.normalize('links/@/node/20.0.0')) + // On Windows, node.exe is hardlinked into .bin/ so process.execPath + // reports the hardlink path rather than the original store location. + // On non-Windows, the symlink is resolved by the kernel. + if (process.platform !== 'win32') { + expect(nodeInfo.execPath).toContain(path.normalize('links/@/node/20.0.0')) + } }) describeOnLinuxOnly('dlx with supportedArchitectures CLI options', () => {