diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 33119009..06674c5a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,4 +49,4 @@ jobs: run: pnpm run build - name: Test - run: pnpm run test --node-version=${{ matrix.node }} + run: TEST262_NODE_VERSION=${{ matrix.node }} pnpm run test diff --git a/.npmrc b/.npmrc index 32124bcc..43a0eb0f 100644 --- a/.npmrc +++ b/.npmrc @@ -2,4 +2,4 @@ prefer-workspace-packages = true engine-strict = true # NOTE: keep synced with ci.yml -use-node-version = ${NODE_VERSION:-18.19.0} +use-node-version = ${PNPM_NODE_VERSION:-18.19.0} diff --git a/package.json b/package.json index a7fb2275..d80d4034 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "ci": "pnpm run clean && pnpm run lint && pnpm run build && pnpm run test", "lint": "pnpm -r run lint", "build": "pnpm -r run build", - "test": "pnpm -r --filter=!@js-temporal/temporal-test262-runner run test", + "test": "pnpm -r --stream --filter=!@js-temporal/temporal-test262-runner run test", "clean": "pnpm -r run clean" }, "devDependencies": { diff --git a/packages/temporal-polyfill/scripts/test262.js b/packages/temporal-polyfill/scripts/test262.js index 4363bac9..459127c5 100755 --- a/packages/temporal-polyfill/scripts/test262.js +++ b/packages/temporal-polyfill/scripts/test262.js @@ -49,29 +49,26 @@ yargs(hideBin(process.argv)) default: false, type: 'boolean', description: 'Whether to test the minified bundle', - }) - .option('node-version', { - requiresArg: true, - type: 'string', - description: 'Force a specific version of Node', }), async (options) => { const currentNodeVersion = process.versions.node const currentNodeMajorVersion = parseInt(currentNodeVersion.split('.')[0]) + const requestedNodeVersion = process.env.TEST262_NODE_VERSION // If different version of Node requested, spawn a new process - if ( - options.nodeVersion && - options.nodeVersion !== currentNodeVersion && - !process.env.NODE_VERSION // not already executing a forced-version call - ) { + if (requestedNodeVersion && requestedNodeVersion !== currentNodeVersion) { return await execLive( ['pnpm', 'exec', 'node', ...process.argv.slice(1)], { cwd: process.cwd(), env: { ...filterEnv(process.env), - NODE_VERSION: options.nodeVersion, // forces PNPM to use specific version (see .npmrc) + + // Forces PNPM to use specific version (see .npmrc) + PNPM_NODE_VERSION: requestedNodeVersion, + + // Clear requestedNodeVersion for spawned process + TEST262_NODE_VERSION: '', }, }, )