diff --git a/packages/temporal-polyfill/scripts/test.js b/packages/temporal-polyfill/scripts/test.js index aff4480a..0388ee8d 100755 --- a/packages/temporal-polyfill/scripts/test.js +++ b/packages/temporal-polyfill/scripts/test.js @@ -65,10 +65,9 @@ yargs(hideBin(process.argv)) ], { cwd: process.cwd(), env: { + ...filterEnv(process.env), // will force PNPM to use a specific version (see .npmrc) NODE_VERSION: options.nodeVersion, - PATH: process.env.PATH, - CI: process.env.CI, } }) } @@ -142,3 +141,15 @@ function liveExec(cmdParts, options = {}) { }) }) } + +function filterEnv(oldEnv) { + const newEnv = {} + + for (const key in oldEnv) { + if (!/node|npm|nvm/i.test(key)) { + newEnv[key] = oldEnv[key] + } + } + + return newEnv +}