diff --git a/.github/workflows/auto-start-ci.yml b/.github/workflows/auto-start-ci.yml index 791acebd609fac..8dfd126cbc340b 100644 --- a/.github/workflows/auto-start-ci.yml +++ b/.github/workflows/auto-start-ci.yml @@ -45,7 +45,7 @@ jobs: if: needs.get-prs-for-ci.outputs.numbers != '' runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/.github/workflows/build-tarball.yml b/.github/workflows/build-tarball.yml index 97cea1132c6f0e..f7bda770103dc6 100644 --- a/.github/workflows/build-tarball.yml +++ b/.github/workflows/build-tarball.yml @@ -4,13 +4,29 @@ on: pull_request: types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - - .mailmap - '**.md' - '**.nix' - - AUTHORS + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml - doc/** + - pyproject.yml + - tsconfig.json - test/internet/** - - .github/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - vcbuild.bat + - .** - '!.github/workflows/build-tarball.yml' push: branches: @@ -18,13 +34,29 @@ on: - v[0-9]+.x-staging - v[0-9]+.x paths-ignore: - - .mailmap - '**.md' - '**.nix' - - AUTHORS + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml - doc/** + - pyproject.yml + - tsconfig.json - test/internet/** - - .github/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - vcbuild.bat + - .** - '!.github/workflows/build-tarball.yml' concurrency: @@ -44,11 +76,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -74,7 +106,7 @@ jobs: CXX: sccache clang++-19 SCCACHE_GHA_ENABLED: 'true' steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false sparse-checkout: .github/actions/install-clang @@ -84,7 +116,7 @@ jobs: with: clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 348110d77a64c8..162eb6277e8624 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -23,19 +23,19 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/init@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6 with: languages: ${{ matrix.language }} config-file: ./.github/codeql-config.yml - name: Autobuild - uses: github/codeql-action/autobuild@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/autobuild@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/analyze@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6 with: category: /language:${{matrix.language}} diff --git a/.github/workflows/commit-lint.yml b/.github/workflows/commit-lint.yml index 0c63c82ab9eccf..03b0d2537a9229 100644 --- a/.github/workflows/commit-lint.yml +++ b/.github/workflows/commit-lint.yml @@ -17,7 +17,7 @@ jobs: run: | echo "plusOne=$((${{ github.event.pull_request.commits }} + 1))" >> $GITHUB_OUTPUT echo "minusOne=$((${{ github.event.pull_request.commits }} - 1))" >> $GITHUB_OUTPUT - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: fetch-depth: ${{ steps.nb-of-commits.outputs.plusOne }} persist-credentials: false diff --git a/.github/workflows/commit-queue.yml b/.github/workflows/commit-queue.yml index 1b06445a9b556a..09e99d69cbf9c6 100644 --- a/.github/workflows/commit-queue.yml +++ b/.github/workflows/commit-queue.yml @@ -59,7 +59,7 @@ jobs: if: needs.get_mergeable_prs.outputs.numbers != '' runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: # A personal token is required because pushing with GITHUB_TOKEN will # prevent commits from running CI after they land. It needs diff --git a/.github/workflows/coverage-linux-without-intl.yml b/.github/workflows/coverage-linux-without-intl.yml index 949faf20db218e..1178787db727b8 100644 --- a/.github/workflows/coverage-linux-without-intl.yml +++ b/.github/workflows/coverage-linux-without-intl.yml @@ -49,7 +49,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Install Clang ${{ env.CLANG_VERSION }} @@ -57,7 +57,7 @@ jobs: with: clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true diff --git a/.github/workflows/coverage-linux.yml b/.github/workflows/coverage-linux.yml index ae671ebe153789..c87fdd18c674e0 100644 --- a/.github/workflows/coverage-linux.yml +++ b/.github/workflows/coverage-linux.yml @@ -49,7 +49,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Install Clang ${{ env.CLANG_VERSION }} @@ -57,7 +57,7 @@ jobs: with: clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true diff --git a/.github/workflows/coverage-windows.yml b/.github/workflows/coverage-windows.yml index caef53f4a45500..9b9804b13fd891 100644 --- a/.github/workflows/coverage-windows.yml +++ b/.github/workflows/coverage-windows.yml @@ -45,11 +45,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: windows-2025 steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true diff --git a/.github/workflows/create-release-proposal.yml b/.github/workflows/create-release-proposal.yml index b918312dc03f40..ba3d5d006fbbaa 100644 --- a/.github/workflows/create-release-proposal.yml +++ b/.github/workflows/create-release-proposal.yml @@ -33,7 +33,7 @@ jobs: RELEASE_LINE: ${{ inputs.release-line }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: ref: ${{ env.STAGING_BRANCH }} persist-credentials: false diff --git a/.github/workflows/daily-wpt-fyi.yml b/.github/workflows/daily-wpt-fyi.yml index 7cbac99adff37d..48ffadd0622500 100644 --- a/.github/workflows/daily-wpt-fyi.yml +++ b/.github/workflows/daily-wpt-fyi.yml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -64,7 +64,7 @@ jobs: SHORT_SHA=$(node -p 'process.version.split(/-nightly\d{8}/)[1]') echo "NIGHTLY_REF=$(gh api /repos/nodejs/node/commits/$SHORT_SHA --jq '.sha')" >> $GITHUB_ENV - name: Checkout ${{ steps.setup-node.outputs.node-version }} - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false ref: ${{ env.NIGHTLY_REF || steps.setup-node.outputs.node-version }} @@ -80,7 +80,7 @@ jobs: run: rm -rf wpt working-directory: test/fixtures - name: Checkout epochs/daily WPT - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: repository: web-platform-tests/wpt persist-credentials: false diff --git a/.github/workflows/daily.yml b/.github/workflows/daily.yml index efe534211ca255..9e9159707d6648 100644 --- a/.github/workflows/daily.yml +++ b/.github/workflows/daily.yml @@ -15,7 +15,7 @@ jobs: build-lto: runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 6e3feddf60f23e..b39acc9c4837b7 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -24,7 +24,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} diff --git a/.github/workflows/find-inactive-collaborators.yml b/.github/workflows/find-inactive-collaborators.yml index f7b9d22ecffeb7..ec72c077f8dabb 100644 --- a/.github/workflows/find-inactive-collaborators.yml +++ b/.github/workflows/find-inactive-collaborators.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: fetch-depth: 0 persist-credentials: false diff --git a/.github/workflows/find-inactive-tsc.yml b/.github/workflows/find-inactive-tsc.yml index 8f69d07fec3691..b2a2724b4cd571 100644 --- a/.github/workflows/find-inactive-tsc.yml +++ b/.github/workflows/find-inactive-tsc.yml @@ -20,13 +20,13 @@ jobs: steps: - name: Checkout the repo - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: fetch-depth: 0 persist-credentials: false - name: Clone nodejs/TSC repository - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: fetch-depth: 0 path: .tmp diff --git a/.github/workflows/license-builder.yml b/.github/workflows/license-builder.yml index e5c594377829ad..6abd7865ea12ba 100644 --- a/.github/workflows/license-builder.yml +++ b/.github/workflows/license-builder.yml @@ -17,7 +17,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - run: ./tools/license-builder.sh # Run the license builder tool diff --git a/.github/workflows/lint-release-proposal.yml b/.github/workflows/lint-release-proposal.yml index f93c79ece5a9df..b97fd6e2f83788 100644 --- a/.github/workflows/lint-release-proposal.yml +++ b/.github/workflows/lint-release-proposal.yml @@ -23,7 +23,7 @@ jobs: contents: read pull-requests: read steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Lint release commit title format diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 9ac4151a5a502a..695bd86b5d95ad 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -25,7 +25,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} @@ -40,11 +40,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -56,7 +56,7 @@ jobs: if: ${{ github.event.pull_request && github.event.pull_request.draft == false && github.base_ref == github.event.repository.default_branch }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: fetch-depth: 0 persist-credentials: false @@ -65,7 +65,7 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -95,7 +95,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Use Node.js ${{ env.NODE_VERSION }} @@ -144,7 +144,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false sparse-checkout: '*.nix' @@ -160,11 +160,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -178,11 +178,11 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Use Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -197,7 +197,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - run: shellcheck -V @@ -207,7 +207,7 @@ jobs: if: github.event.pull_request.draft == false runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - uses: mszostok/codeowners-validator@7f3f5e28c6d7b8dfae5731e54ce2272ca384592f @@ -217,7 +217,7 @@ jobs: if: ${{ github.event.pull_request }} runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: fetch-depth: 2 persist-credentials: false @@ -226,7 +226,7 @@ jobs: lint-readme: runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Get team members if possible diff --git a/.github/workflows/notify-on-push.yml b/.github/workflows/notify-on-push.yml index abbfd9ee1469a4..4315dccfd2d54b 100644 --- a/.github/workflows/notify-on-push.yml +++ b/.github/workflows/notify-on-push.yml @@ -35,7 +35,7 @@ jobs: contents: read pull-requests: write steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Check commit message diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml index 8db2ba7735691f..0b9af14977c71a 100644 --- a/.github/workflows/scorecard.yml +++ b/.github/workflows/scorecard.yml @@ -38,7 +38,7 @@ jobs: egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs - name: Checkout code - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false @@ -73,6 +73,6 @@ jobs: # Upload the results to GitHub's code scanning dashboard. - name: Upload to code-scanning - uses: github/codeql-action/upload-sarif@014f16e7ab1402f30e7c3329d33797e7948572db # v4.31.3 + uses: github/codeql-action/upload-sarif@fe4161a26a8629af62121b670040955b330f9af2 # v4.31.6 with: sarif_file: results.sarif diff --git a/.github/workflows/test-internet.yml b/.github/workflows/test-internet.yml index d77d4c766edebf..b6b0e9e2f3b58f 100644 --- a/.github/workflows/test-internet.yml +++ b/.github/workflows/test-internet.yml @@ -46,7 +46,7 @@ jobs: if: github.event_name == 'schedule' && github.repository == 'nodejs/node' || github.event.pull_request.draft == false runs-on: ubuntu-24.04 steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Install Clang ${{ env.CLANG_VERSION }} @@ -54,7 +54,7 @@ jobs: with: clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true diff --git a/.github/workflows/test-linux.yml b/.github/workflows/test-linux.yml index 3b4283df4163ad..b603484cbbaf4c 100644 --- a/.github/workflows/test-linux.yml +++ b/.github/workflows/test-linux.yml @@ -48,7 +48,7 @@ jobs: matrix: os: [ubuntu-24.04, ubuntu-24.04-arm] steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: node @@ -57,7 +57,7 @@ jobs: with: clang-version: ${{ env.CLANG_VERSION }} - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index 4551f5184f6c6a..2924cfbdd79cc0 100644 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -4,13 +4,29 @@ on: pull_request: types: [opened, synchronize, reopened, ready_for_review] paths-ignore: - - .mailmap - '**.md' - '**.nix' - - AUTHORS + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml - doc/** + - pyproject.yml + - tsconfig.json - test/internet/** - - .github/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - vcbuild.bat + - .** - '!.github/workflows/test-macos.yml' push: branches: @@ -19,13 +35,29 @@ on: - v[0-9]+.x-staging - v[0-9]+.x paths-ignore: - - .mailmap - '**.md' - '**.nix' - - AUTHORS + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml - doc/** + - pyproject.yml + - tsconfig.json - test/internet/** - - .github/** + - tools/actions/** + - tools/bootstrap/** + - tools/dep_updaters/** + - tools/doc/** + - tools/eslint-rules/** + - tools/eslint/** + - tools/lint-md/** + - typings/** + - vcbuild.bat + - .** - '!.github/workflows/test-macos.yml' concurrency: @@ -51,12 +83,12 @@ jobs: CXX: sccache g++ SCCACHE_GHA_ENABLED: 'true' steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false path: node - name: Set up Python ${{ env.PYTHON_VERSION }} - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true diff --git a/.github/workflows/test-shared.yml b/.github/workflows/test-shared.yml index 165c8f81bde87e..99c0920cdf0bec 100644 --- a/.github/workflows/test-shared.yml +++ b/.github/workflows/test-shared.yml @@ -5,9 +5,14 @@ name: Test Shared libraries on: pull_request: paths-ignore: - - .mailmap - '**.md' - - AUTHORS + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml - deps/ada/** - deps/brotli/** - deps/cares/** @@ -26,8 +31,17 @@ on: - deps/zlib/** - deps/zstd/** - doc/** + - pyproject.yml + - tsconfig.json - test/internet/** - - .github/** + - tools/** + - '!tools/gyp/**' + - '!tools/nix/**' + - '!tools/v8/**' + - '!tools/v8_gypfiles/**' + - typings/** + - vcbuild.bat + - .** - '!.github/workflows/test-shared.yml' types: [opened, synchronize, reopened, ready_for_review] push: @@ -37,9 +51,14 @@ on: - v[0-9]+.x-staging - v[0-9]+.x paths-ignore: - - .mailmap - '**.md' - - AUTHORS + - eslint.config.mjs + - '**/eslint.config_partial.mjs' + - android-configure + - android-configure.py + - android-patches/** + - benchmarks/** + - codecov.yml - deps/ada/** - deps/brotli/** - deps/cares/** @@ -58,8 +77,17 @@ on: - deps/zlib/** - deps/zstd/** - doc/** + - pyproject.yml + - tsconfig.json - test/internet/** - - .github/** + - tools/** + - '!tools/gyp/**' + - '!tools/nix/**' + - '!tools/v8/**' + - '!tools/v8_gypfiles/**' + - typings/** + - vcbuild.bat + - .** - '!.github/workflows/test-shared.yml' concurrency: @@ -78,7 +106,7 @@ jobs: name: ${{ github.event_name == 'workflow_dispatch' && 'Skipped job' || 'Build slim tarball' }} runs-on: ubuntu-24.04-arm steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 if: ${{ github.event_name != 'workflow_dispatch' }} with: persist-credentials: false @@ -164,7 +192,7 @@ jobs: --arg ccache '(import {}).sccache' \ --arg devTools '[]' \ --arg benchmarkTools '[]' \ - ${{ endsWith(matrix.system, '-darwin') && '--arg extraConfigFlags ''["--without-inspector"]'' \' || '\' }} + ${{ endsWith(matrix.system, '-darwin') && '--arg extraConfigFlags ''["--without-amaro" "--without-inspector"]'' \' || '\' }} --run ' make -C "$TAR_DIR" run-ci -j4 V=1 TEST_CI_ARGS="-p actions --measure-flakiness 9 --skip-tests=$CI_SKIP_TESTS" ' diff --git a/.github/workflows/timezone-update.yml b/.github/workflows/timezone-update.yml index 5f330165c35930..5465298fa9da50 100644 --- a/.github/workflows/timezone-update.yml +++ b/.github/workflows/timezone-update.yml @@ -20,12 +20,12 @@ jobs: steps: - name: Checkout nodejs/node - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Checkout unicode-org/icu-data - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: path: icu-data persist-credentials: false diff --git a/.github/workflows/tools.yml b/.github/workflows/tools.yml index 1018558c5f7d68..bf5549baa32017 100644 --- a/.github/workflows/tools.yml +++ b/.github/workflows/tools.yml @@ -301,7 +301,7 @@ jobs: run: | git config --global user.name "Node.js GitHub Bot" git config --global user.email "github-bot@iojs.org" - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id with: persist-credentials: false @@ -309,7 +309,7 @@ jobs: if: | (matrix.id == 'icu' || matrix.id == 'inspector_protocol') && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id) - uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 + uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 with: python-version: ${{ env.PYTHON_VERSION }} allow-prereleases: true @@ -324,7 +324,7 @@ jobs: if: env.COMMIT_MSG == '' && (github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id) run: | echo "COMMIT_MSG=${{ matrix.subsystem }}: update ${{ matrix.id }} to ${{ env.NEW_VERSION }}" >> "$GITHUB_ENV" - - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 + - uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9 if: github.event_name == 'schedule' || inputs.id == 'all' || inputs.id == matrix.id # Creates a PR or update the Action's existing PR, or # no-op if the base branch is already up-to-date. diff --git a/.github/workflows/update-openssl.yml b/.github/workflows/update-openssl.yml index 03130109faf44a..ccd9868b6c50e5 100644 --- a/.github/workflows/update-openssl.yml +++ b/.github/workflows/update-openssl.yml @@ -14,7 +14,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Check and download new OpenSSL version diff --git a/.github/workflows/update-v8.yml b/.github/workflows/update-v8.yml index 49760188333b22..b7469a7787d8a3 100644 --- a/.github/workflows/update-v8.yml +++ b/.github/workflows/update-v8.yml @@ -16,7 +16,7 @@ jobs: if: github.repository == 'nodejs/node' runs-on: ubuntu-latest steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false - name: Cache node modules and update-v8 @@ -45,7 +45,7 @@ jobs: cat temp-output tail -n1 temp-output | grep "NEW_VERSION=" >> "$GITHUB_ENV" || true rm temp-output - - uses: peter-evans/create-pull-request@271a8d0340265f705b14b6d32b9829c1cb33d45e # v7.0.8 + - uses: peter-evans/create-pull-request@84ae59a2cdc2258d6fa0732dd66352dddae2a412 # v7.0.9 # Creates a PR or update the Action's existing PR, or # no-op if the base branch is already up-to-date. with: diff --git a/.github/workflows/update-wpt.yml b/.github/workflows/update-wpt.yml index 75b961d9003632..f4cae25ee591a2 100644 --- a/.github/workflows/update-wpt.yml +++ b/.github/workflows/update-wpt.yml @@ -27,7 +27,7 @@ jobs: subsystem: ${{ fromJSON(github.event.inputs.subsystems || '["url", "urlpattern", "WebCryptoAPI"]') }} steps: - - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1 + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 with: persist-credentials: false diff --git a/doc/api/util.md b/doc/api/util.md index 37bdcd02bc55bb..9a02eb43c45b76 100644 --- a/doc/api/util.md +++ b/doc/api/util.md @@ -564,6 +564,9 @@ changes: Returns an array of call site objects containing the stack of the caller function. +Unlike accessing an `error.stack`, the result returned from this API is not +interfered with `Error.prepareStackTrace`. + ```mjs import { getCallSites } from 'node:util'; diff --git a/lib/internal/webstreams/writablestream.js b/lib/internal/webstreams/writablestream.js index 458ab8d45de5a7..ca20c08b258c3c 100644 --- a/lib/internal/webstreams/writablestream.js +++ b/lib/internal/webstreams/writablestream.js @@ -76,6 +76,8 @@ const { const { kIsClosedPromise, + kIsErrored, + kIsWritable, kControllerErrorFunction, } = require('internal/streams/utils'); @@ -183,6 +185,14 @@ class WritableStream { size); } + get [kIsErrored]() { + return this[kState].state === 'errored'; + } + + get [kIsWritable]() { + return this[kState].state === 'writable'; + } + /** * @readonly * @type {boolean} diff --git a/test/es-module/test-disable-require-module-with-detection.js b/test/es-module/test-disable-require-module-with-detection.js index 3ac5ec82171587..7823dd03121118 100644 --- a/test/es-module/test-disable-require-module-with-detection.js +++ b/test/es-module/test-disable-require-module-with-detection.js @@ -15,5 +15,5 @@ assert.throws( () => require('../fixtures/es-modules/loose.js'), { name: 'SyntaxError', - message: /Unexpected token 'export'/ + message: /Unexpected token 'export'/, }); diff --git a/test/es-module/test-dynamic-import-script-lifetime.js b/test/es-module/test-dynamic-import-script-lifetime.js index 7ccea887109e05..fc0e35d29f649c 100644 --- a/test/es-module/test-dynamic-import-script-lifetime.js +++ b/test/es-module/test-dynamic-import-script-lifetime.js @@ -28,5 +28,5 @@ vm.runInThisContext(code, { await m.link(() => {}); await m.evaluate(); return m; - } + }, }); diff --git a/test/es-module/test-esm-cjs-named-error.mjs b/test/es-module/test-esm-cjs-named-error.mjs index 6ece31ed3adc8a..98dedbf065f321 100644 --- a/test/es-module/test-esm-cjs-named-error.mjs +++ b/test/es-module/test-esm-cjs-named-error.mjs @@ -27,21 +27,21 @@ await assert.rejects(async () => { await import(`${fixtureBase}/single-quote.mjs`); }, { name: 'SyntaxError', - message: expectedRelative + message: expectedRelative, }, 'should support relative specifiers with single quotes'); await assert.rejects(async () => { await import(`${fixtureBase}/double-quote.mjs`); }, { name: 'SyntaxError', - message: expectedRelative + message: expectedRelative, }, 'should support relative specifiers with double quotes'); await assert.rejects(async () => { await import(`${fixtureBase}/renamed-import.mjs`); }, { name: 'SyntaxError', - message: expectedRenamed + message: expectedRenamed, }, 'should correctly format named imports with renames'); await assert.rejects(async () => { @@ -55,21 +55,21 @@ await assert.rejects(async () => { await import(`${fixtureBase}/json-hack.mjs`); }, { name: 'SyntaxError', - message: expectedPackageHack + message: expectedPackageHack, }, 'should respect recursive package.json for module type'); await assert.rejects(async () => { await import(`${fixtureBase}/bare-import-single.mjs`); }, { name: 'SyntaxError', - message: expectedBare + message: expectedBare, }, 'should support bare specifiers with single quotes'); await assert.rejects(async () => { await import(`${fixtureBase}/bare-import-double.mjs`); }, { name: 'SyntaxError', - message: expectedBare + message: expectedBare, }, 'should support bare specifiers with double quotes'); await assert.rejects(async () => { diff --git a/test/es-module/test-esm-data-urls.js b/test/es-module/test-esm-data-urls.js index 21f4e94930b1cc..ddf4a3655da97e 100644 --- a/test/es-module/test-esm-data-urls.js +++ b/test/es-module/test-esm-data-urls.js @@ -76,7 +76,7 @@ function createBase64URL(mime, body) { import('data:application/json;foo="test,",0', { with: { type: 'json' } }), { name: 'SyntaxError', - message: /Unterminated string in JSON at position 3/ + message: /Unterminated string in JSON at position 3/, }); } { diff --git a/test/es-module/test-esm-dns-promises.mjs b/test/es-module/test-esm-dns-promises.mjs index 149682db02d042..1256bb75a2b83c 100644 --- a/test/es-module/test-esm-dns-promises.mjs +++ b/test/es-module/test-esm-dns-promises.mjs @@ -10,5 +10,5 @@ assert.throws(() => { }, { code: 'ERR_INVALID_ARG_VALUE', name: 'TypeError', - message: `The argument 'address' is invalid. Received '${invalidAddress}'` + message: `The argument 'address' is invalid. Received '${invalidAddress}'`, }); diff --git a/test/es-module/test-esm-dynamic-import.js b/test/es-module/test-esm-dynamic-import.js index 47995d50d9cd7a..4cf7b769a00cfa 100644 --- a/test/es-module/test-esm-dynamic-import.js +++ b/test/es-module/test-esm-dynamic-import.js @@ -19,7 +19,7 @@ function expectOkNamespace(result) { .then(common.mustCall((ns) => { const expected = { default: true }; Object.defineProperty(expected, Symbol.toStringTag, { - value: 'Module' + value: 'Module', }); Object.setPrototypeOf(expected, Object.getPrototypeOf(ns)); assert.deepStrictEqual(ns, expected); diff --git a/test/es-module/test-esm-import-meta.mjs b/test/es-module/test-esm-import-meta.mjs index a2575c4d108cc1..638989724bbfd4 100644 --- a/test/es-module/test-esm-import-meta.mjs +++ b/test/es-module/test-esm-import-meta.mjs @@ -12,7 +12,7 @@ for (const descriptor of Object.values(descriptors)) { assert.deepStrictEqual(descriptor, { enumerable: true, writable: true, - configurable: true + configurable: true, }); } diff --git a/test/es-module/test-esm-loader-invalid-format.mjs b/test/es-module/test-esm-loader-invalid-format.mjs index 64237f7af243af..5a16381e58897f 100644 --- a/test/es-module/test-esm-loader-invalid-format.mjs +++ b/test/es-module/test-esm-loader-invalid-format.mjs @@ -5,6 +5,6 @@ import assert from 'assert'; import('../fixtures/es-modules/test-esm-ok.mjs') .then(assert.fail, expectsError({ code: 'ERR_UNKNOWN_MODULE_FORMAT', - message: /Unknown module format: esm/ + message: /Unknown module format: esm/, })) .then(mustCall()); diff --git a/test/es-module/test-esm-loader-mock.mjs b/test/es-module/test-esm-loader-mock.mjs index 164d0ac3775039..cdf56d85415b74 100644 --- a/test/es-module/test-esm-loader-mock.mjs +++ b/test/es-module/test-esm-loader-mock.mjs @@ -3,21 +3,21 @@ import assert from 'node:assert/strict'; import { mock } from '../fixtures/es-module-loaders/mock.mjs'; mock('node:events', { - EventEmitter: 'This is mocked!' + EventEmitter: 'This is mocked!', }); // This resolves to node:events // It is intercepted by mock-loader and doesn't return the normal value assert.deepStrictEqual(await import('events'), Object.defineProperty({ __proto__: null, - EventEmitter: 'This is mocked!' + EventEmitter: 'This is mocked!', }, Symbol.toStringTag, { enumerable: false, - value: 'Module' + value: 'Module', })); const mutator = mock('node:events', { - EventEmitter: 'This is mocked v2!' + EventEmitter: 'This is mocked v2!', }); // It is intercepted by mock-loader and doesn't return the normal value. @@ -26,17 +26,17 @@ const mutator = mock('node:events', { const mockedV2 = await import('node:events'); assert.deepStrictEqual(mockedV2, Object.defineProperty({ __proto__: null, - EventEmitter: 'This is mocked v2!' + EventEmitter: 'This is mocked v2!', }, Symbol.toStringTag, { enumerable: false, - value: 'Module' + value: 'Module', })); mutator.EventEmitter = 'This is mocked v3!'; assert.deepStrictEqual(mockedV2, Object.defineProperty({ __proto__: null, - EventEmitter: 'This is mocked v3!' + EventEmitter: 'This is mocked v3!', }, Symbol.toStringTag, { enumerable: false, - value: 'Module' + value: 'Module', })); diff --git a/test/es-module/test-esm-loader-modulemap.js b/test/es-module/test-esm-loader-modulemap.js index c725f093fa3bda..ba0358368ec167 100644 --- a/test/es-module/test-esm-loader-modulemap.js +++ b/test/es-module/test-esm-loader-modulemap.js @@ -55,7 +55,7 @@ const jsonModuleJob = new ModuleJob(loader, jsonModuleDataUrl, const errorObj = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "url" argument must be of type string/ + message: /^The "url" argument must be of type string/, }; [{}, [], true, 1].forEach((value) => { @@ -73,7 +73,7 @@ const jsonModuleJob = new ModuleJob(loader, jsonModuleDataUrl, const errorObj = { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "type" argument must be of type string/ + message: /^The "type" argument must be of type string/, }; [{}, [], true, 1].forEach((value) => { @@ -91,7 +91,7 @@ const jsonModuleJob = new ModuleJob(loader, jsonModuleDataUrl, assert.throws(() => moduleMap.set('', undefined, value), { code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', - message: /^The "job" argument must be an instance of ModuleJob/ + message: /^The "job" argument must be an instance of ModuleJob/, }); }); } diff --git a/test/es-module/test-esm-loader-search.js b/test/es-module/test-esm-loader-search.js index 3c451409b356db..5f25edadb7cbb1 100644 --- a/test/es-module/test-esm-loader-search.js +++ b/test/es-module/test-esm-loader-search.js @@ -7,7 +7,7 @@ require('../common'); const assert = require('assert'); const { - defaultResolve: resolve + defaultResolve: resolve, } = require('internal/modules/esm/resolve'); assert.throws( @@ -15,6 +15,6 @@ assert.throws( { code: 'ERR_MODULE_NOT_FOUND', name: 'Error', - message: /Cannot find package 'target'/ + message: /Cannot find package 'target'/, } ); diff --git a/test/es-module/test-esm-resolve-type.mjs b/test/es-module/test-esm-resolve-type.mjs index fbd75d98a8da8e..f6e519f320cd6d 100644 --- a/test/es-module/test-esm-resolve-type.mjs +++ b/test/es-module/test-esm-resolve-type.mjs @@ -25,7 +25,7 @@ if (!isMainThread) { import assert from 'assert'; import internalResolve from 'node:internal/modules/esm/resolve'; const { - defaultResolve: resolve + defaultResolve: resolve, } = internalResolve; const rel = (file) => tmpdir.resolve(file); @@ -82,7 +82,7 @@ try { createDir(subDir); const pkgJsonContent = { ...(moduleType !== undefined) && { type: moduleType }, - main: `subdir/mainfile.${moduleExtension}` + main: `subdir/mainfile.${moduleExtension}`, }; fs.writeFileSync(pkg, JSON.stringify(pkgJsonContent)); fs.writeFileSync(script, @@ -150,13 +150,13 @@ try { '.': { 'require': './lib/index.js', 'import': './es/index.js', - 'default': './lib/index.js' + 'default': './lib/index.js', }, './package.json': './package.json', - } + }, }; const esmPkgJsonContent = { - type: 'module' + type: 'module', }; fs.writeFileSync(pkg, JSON.stringify(mainPkgJsonContent)); @@ -220,13 +220,13 @@ try { '.': { 'require': `./subdir/${mainRequireScript}${mainSuffix}`, 'import': `./subdir/${mainImportScript}${mainSuffix}`, - 'default': `./subdir/${mainRequireScript}${mainSuffix}` + 'default': `./subdir/${mainRequireScript}${mainSuffix}`, }, './package.json': './package.json', - } + }, }; const subdirPkgJsonContent = { - type: `${subdirPackageType}` + type: `${subdirPackageType}`, }; fs.writeFileSync(pkg, JSON.stringify(mainPkgJsonContent)); diff --git a/test/es-module/test-esm-symlink-type.js b/test/es-module/test-esm-symlink-type.js index 2537881f46c0e2..76f03d4f46d457 100644 --- a/test/es-module/test-esm-symlink-type.js +++ b/test/es-module/test-esm-symlink-type.js @@ -16,12 +16,12 @@ const symlinks = [ source: 'extensionless-symlink-to-mjs-file', target: fixtures.path('es-modules/mjs-file.mjs'), prints: '.mjs file', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, { source: 'extensionless-symlink-to-cjs-file', target: fixtures.path('es-modules/cjs-file.cjs'), prints: '.cjs file', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, { source: 'extensionless-symlink-to-file-in-module-scope', target: fixtures.path('es-modules/package-type-module/index.js'), @@ -29,17 +29,17 @@ const symlinks = [ // The package scope of the symlinks' sources is commonjs, and this // symlink's target is a .js file in a module scope, so when the scope // is evaluated based on the source (commonjs) this esm file should error - errorsWithPreserveSymlinksMain: true + errorsWithPreserveSymlinksMain: true, }, { source: 'extensionless-symlink-to-file-in-explicit-commonjs-scope', target: fixtures.path('es-modules/package-type-commonjs/index.js'), prints: 'package-type-commonjs', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, { source: 'extensionless-symlink-to-file-in-implicit-commonjs-scope', target: fixtures.path('es-modules/package-without-type/index.js'), prints: 'package-without-type', - errorsWithPreserveSymlinksMain: false + errorsWithPreserveSymlinksMain: false, }, ]; @@ -53,7 +53,7 @@ symlinks.forEach((symlink) => { ]; flags.forEach((nodeOptions) => { const opts = { - env: Object.assign({}, process.env, { NODE_OPTIONS: nodeOptions }) + env: Object.assign({}, process.env, { NODE_OPTIONS: nodeOptions }), }; exec(process.execPath, [mainPath], opts, common.mustCall( (err, stdout) => { diff --git a/test/es-module/test-esm-type-field-errors-2.js b/test/es-module/test-esm-type-field-errors-2.js index 3ea259446c7fb2..73f581badb9159 100644 --- a/test/es-module/test-esm-type-field-errors-2.js +++ b/test/es-module/test-esm-type-field-errors-2.js @@ -11,7 +11,7 @@ const { describe, it } = require('node:test'); describe('Errors related to ESM type field', () => { it('Should throw an error when loading CJS from a `type: "module"` package.', () => { assert.throws(() => require('../fixtures/es-modules/package-type-module/index.js'), { - code: 'ERR_REQUIRE_ESM' + code: 'ERR_REQUIRE_ESM', }); }); }); diff --git a/test/es-module/test-esm-wasm-module-instances-warning.mjs b/test/es-module/test-esm-wasm-module-instances-warning.mjs index e8ca55258131d6..e2cc5a73121abd 100644 --- a/test/es-module/test-esm-wasm-module-instances-warning.mjs +++ b/test/es-module/test-esm-wasm-module-instances-warning.mjs @@ -12,6 +12,6 @@ spawnSyncAndAssert( stderr(output) { assert.match(output, /ExperimentalWarning/); assert.match(output, /Importing WebAssembly module instances/); - } + }, } ); diff --git a/test/es-module/test-esm-wasm-source-phase-not-defined-static.mjs b/test/es-module/test-esm-wasm-source-phase-not-defined-static.mjs index a53ea04194f149..73c519a37f68cb 100644 --- a/test/es-module/test-esm-wasm-source-phase-not-defined-static.mjs +++ b/test/es-module/test-esm-wasm-source-phase-not-defined-static.mjs @@ -14,6 +14,6 @@ spawnSyncAndAssert( stderr(output) { assert.match(output, /Source phase import object is not defined for module/); assert(output.includes(fileUrl)); - } + }, } ); diff --git a/test/es-module/test-esm-wasm-top-level-execution.mjs b/test/es-module/test-esm-wasm-top-level-execution.mjs index 99ce94e00c5350..cc52ec3e908cff 100644 --- a/test/es-module/test-esm-wasm-top-level-execution.mjs +++ b/test/es-module/test-esm-wasm-top-level-execution.mjs @@ -9,6 +9,6 @@ spawnSyncAndAssert( { stdout: '[Object: null prototype] { prop: \'hello world\' }', stderr: '', - trim: true + trim: true, } ); diff --git a/test/es-module/test-import-require-tla-twice.js b/test/es-module/test-import-require-tla-twice.js index a7cb32a983e3c1..7dc8e2d6448b26 100644 --- a/test/es-module/test-import-require-tla-twice.js +++ b/test/es-module/test-import-require-tla-twice.js @@ -16,6 +16,6 @@ spawnSyncAndAssert( stdout(output) { const matches = output.matchAll(/e\.code === ERR_REQUIRE_ASYNC_MODULE true/g); assert.strictEqual([...matches].length, 2); - } + }, } ); diff --git a/test/es-module/test-loaders-hidden-from-users.js b/test/es-module/test-loaders-hidden-from-users.js index e1b5518e90cbfe..53f48da6e2381f 100644 --- a/test/es-module/test-loaders-hidden-from-users.js +++ b/test/es-module/test-loaders-hidden-from-users.js @@ -10,7 +10,7 @@ assert.throws( require('internal/bootstrap/realm'); }, { code: 'MODULE_NOT_FOUND', - message: /Cannot find module 'internal\/bootstrap\/realm'/ + message: /Cannot find module 'internal\/bootstrap\/realm'/, } ); @@ -23,6 +23,6 @@ assert.throws( require('owo'); }, { code: 'MODULE_NOT_FOUND', - message: /Cannot find module 'owo'/ + message: /Cannot find module 'owo'/, } ); diff --git a/test/es-module/test-loaders-unknown-builtin-module.mjs b/test/es-module/test-loaders-unknown-builtin-module.mjs index 85181a2b73b54c..c97e52d1e63d50 100644 --- a/test/es-module/test-loaders-unknown-builtin-module.mjs +++ b/test/es-module/test-loaders-unknown-builtin-module.mjs @@ -7,6 +7,6 @@ const unknownBuiltinModule = 'node:unknown-builtin-module'; import(unknownBuiltinModule) .then(assert.fail, expectsError({ code: 'ERR_UNKNOWN_BUILTIN_MODULE', - message: `No such built-in module: ${unknownBuiltinModule}` + message: `No such built-in module: ${unknownBuiltinModule}`, })) .then(mustCall()); diff --git a/test/es-module/test-require-as-esm-interop.mjs b/test/es-module/test-require-as-esm-interop.mjs index 8364fd6c2fceca..dd709452df8fe9 100644 --- a/test/es-module/test-require-as-esm-interop.mjs +++ b/test/es-module/test-require-as-esm-interop.mjs @@ -9,7 +9,7 @@ const tests = { 'object': { a: 'cjs a', b: 'cjs b' }, 'fauxesmdefault': { default: 'faux esm default' }, 'fauxesmmixed': { default: 'faux esm default', a: 'faux esm a', b: 'faux esm b' }, - 'fauxesmnamed': { a: 'faux esm a', b: 'faux esm b' } + 'fauxesmnamed': { a: 'faux esm a', b: 'faux esm b' }, }; // This test demonstrates interop between CJS and CJS represented as ESM diff --git a/test/es-module/test-require-esm-from-imported-cjs.js b/test/es-module/test-require-esm-from-imported-cjs.js index b03b41beb1208e..bbce967a4b7e0b 100644 --- a/test/es-module/test-require-esm-from-imported-cjs.js +++ b/test/es-module/test-require-esm-from-imported-cjs.js @@ -17,7 +17,7 @@ spawnSyncAndAssert( ], { trim: true, - stdout: / default: { hello: 'world' }/ + stdout: / default: { hello: 'world' }/, } ); @@ -31,6 +31,6 @@ spawnSyncAndAssert( ], { trim: true, - stdout: / default: { hello: 'world' }/ + stdout: / default: { hello: 'world' }/, } ); diff --git a/test/es-module/test-require-module-conditional-exports.js b/test/es-module/test-require-module-conditional-exports.js index 354c8b72abc7a1..60b7a3ba8b73af 100644 --- a/test/es-module/test-require-module-conditional-exports.js +++ b/test/es-module/test-require-module-conditional-exports.js @@ -17,7 +17,7 @@ const { isModuleNamespaceObject } = require('util/types'); assert.throws(() => { require('../fixtures/es-modules/exports-import-only/load.cjs'); }, { - code: 'ERR_PACKAGE_PATH_NOT_EXPORTED' + code: 'ERR_PACKAGE_PATH_NOT_EXPORTED', }); // If both are defined, "require" is used. diff --git a/test/es-module/test-require-module-cycle-esm-esm-cjs-esm.js b/test/es-module/test-require-module-cycle-esm-esm-cjs-esm.js index edec79e276d21c..3af049baa9a281 100644 --- a/test/es-module/test-require-module-cycle-esm-esm-cjs-esm.js +++ b/test/es-module/test-require-module-cycle-esm-esm-cjs-esm.js @@ -21,7 +21,7 @@ const assert = require('assert'); assert.match(output, /Start c/); assert.match(output, /dynamic import b\.mjs failed.*ERR_REQUIRE_CYCLE_MODULE/); assert.match(output, /dynamic import d\.mjs failed.*ERR_REQUIRE_CYCLE_MODULE/); - } + }, } ); } diff --git a/test/es-module/test-require-module-dont-detect-cjs.js b/test/es-module/test-require-module-dont-detect-cjs.js index 99f49bc59d17c4..8d0c3291af73c8 100644 --- a/test/es-module/test-require-module-dont-detect-cjs.js +++ b/test/es-module/test-require-module-dont-detect-cjs.js @@ -7,5 +7,5 @@ const assert = require('assert'); assert.throws(() => { require('../fixtures/es-modules/es-note-unexpected-export-1.cjs'); }, { - message: /Unexpected token 'export'/ + message: /Unexpected token 'export'/, }); diff --git a/test/es-module/test-require-module-error-catching.js b/test/es-module/test-require-module-error-catching.js index 5400564b3182c6..411ac511a341e3 100644 --- a/test/es-module/test-require-module-error-catching.js +++ b/test/es-module/test-require-module-error-catching.js @@ -9,7 +9,7 @@ const assert = require('assert'); assert.throws(() => { require('../fixtures/es-modules/runtime-error-esm.js'); }, { - message: 'hello' + message: 'hello', }); // References errors should be caught too. @@ -17,5 +17,5 @@ assert.throws(() => { require('../fixtures/es-modules/reference-error-esm.js'); }, { name: 'ReferenceError', - message: 'exports is not defined in ES module scope' + message: 'exports is not defined in ES module scope', }); diff --git a/test/es-module/test-require-module-implicit.js b/test/es-module/test-require-module-implicit.js index e9483ba4da1192..c1bbf3f64561e2 100644 --- a/test/es-module/test-require-module-implicit.js +++ b/test/es-module/test-require-module-implicit.js @@ -12,7 +12,7 @@ const assert = require('assert'); assert.throws(() => { require(id); }, { - code: 'MODULE_NOT_FOUND' + code: 'MODULE_NOT_FOUND', }); const mod = require(`${id}.mjs`); common.expectRequiredModule(mod, { hello: 'world' }); diff --git a/test/es-module/test-require-module-preload.js b/test/es-module/test-require-module-preload.js index 0b8b79118ee8e6..629601c4fc26de 100644 --- a/test/es-module/test-require-module-preload.js +++ b/test/es-module/test-require-module-preload.js @@ -16,7 +16,7 @@ function testPreload(preloadFlag) { './printA.js', ], { - cwd: fixturesDir + cwd: fixturesDir, }, { stdout: 'A', @@ -36,7 +36,7 @@ function testPreload(preloadFlag) { './printA.js', ], { - cwd: fixturesDir + cwd: fixturesDir, }, { stdout: /^world\s+A$/, @@ -56,7 +56,7 @@ function testPreload(preloadFlag) { './printA.js', ], { - cwd: fixturesDir + cwd: fixturesDir, }, { stdout: /^ok\s+A$/, @@ -78,7 +78,7 @@ function testPreload(preloadFlag) { './printA.js', ], { - cwd: fixturesDir + cwd: fixturesDir, }, { stdout: /^world\s+A$/, @@ -103,7 +103,7 @@ testPreload('--import'); './printA.js', ], { - cwd: fixturesDir + cwd: fixturesDir, }, { stdout: /^package-type-module\s+A$/, diff --git a/test/es-module/test-require-module-retry-import-errored.js b/test/es-module/test-require-module-retry-import-errored.js index 4736087d2624a5..8b72adc76a26fe 100644 --- a/test/es-module/test-require-module-retry-import-errored.js +++ b/test/es-module/test-require-module-retry-import-errored.js @@ -9,7 +9,7 @@ const { exportedReject } = require('../fixtures/es-modules/tla/export-promise.mj assert.throws(() => { require('../fixtures/es-modules/tla/await-export-promise.mjs'); }, { - code: 'ERR_REQUIRE_ASYNC_MODULE' + code: 'ERR_REQUIRE_ASYNC_MODULE', }); const interval = setInterval(() => {}, 1000); // Keep the test running, because await alone doesn't. diff --git a/test/es-module/test-require-module-retry-import-evaluating.js b/test/es-module/test-require-module-retry-import-evaluating.js index df70432f1136e4..e9178db75a6eb6 100644 --- a/test/es-module/test-require-module-retry-import-evaluating.js +++ b/test/es-module/test-require-module-retry-import-evaluating.js @@ -9,7 +9,7 @@ const { exportedResolve } = require('../fixtures/es-modules/tla/export-promise.m assert.throws(() => { require('../fixtures/es-modules/tla/await-export-promise.mjs'); }, { - code: 'ERR_REQUIRE_ASYNC_MODULE' + code: 'ERR_REQUIRE_ASYNC_MODULE', }); const interval = setInterval(() => {}, 1000); // Keep the test running, because await alone doesn't. diff --git a/test/es-module/test-require-module-tla-execution.js b/test/es-module/test-require-module-tla-execution.js index bdd222d1f8fa0b..cd9f1b972c63e5 100644 --- a/test/es-module/test-require-module-tla-execution.js +++ b/test/es-module/test-require-module-tla-execution.js @@ -21,6 +21,6 @@ const fixtures = require('../common/fixtures'); assert.match(output, /Requiring .*execution\.mjs/); return true; }, - stdout: '' + stdout: '', }); } diff --git a/test/es-module/test-require-module-tla-print-execution.js b/test/es-module/test-require-module-tla-print-execution.js index 40992ae32e0905..d831856fe676dd 100644 --- a/test/es-module/test-require-module-tla-print-execution.js +++ b/test/es-module/test-require-module-tla-print-execution.js @@ -24,6 +24,6 @@ const fixtures = require('../common/fixtures'); assert.match(output, /Requiring .*execution\.mjs/); return true; }, - stdout: '' + stdout: '', }); } diff --git a/test/es-module/test-require-module-tla-retry-import-2.js b/test/es-module/test-require-module-tla-retry-import-2.js index 2ca8e07449c2fa..afbdf349047837 100644 --- a/test/es-module/test-require-module-tla-retry-import-2.js +++ b/test/es-module/test-require-module-tla-retry-import-2.js @@ -18,7 +18,7 @@ async function test() { assert.throws(() => { require('../fixtures/es-modules/tla/export-async.mjs'); }, { - code: 'ERR_REQUIRE_ASYNC_MODULE' + code: 'ERR_REQUIRE_ASYNC_MODULE', }); } diff --git a/test/es-module/test-require-module-tla-retry-import.js b/test/es-module/test-require-module-tla-retry-import.js index 80b289fdfc8c43..e1d72e7ea6f80d 100644 --- a/test/es-module/test-require-module-tla-retry-import.js +++ b/test/es-module/test-require-module-tla-retry-import.js @@ -9,7 +9,7 @@ async function test() { assert.throws(() => { require('../fixtures/es-modules/tla/export-async.mjs'); }, { - code: 'ERR_REQUIRE_ASYNC_MODULE' + code: 'ERR_REQUIRE_ASYNC_MODULE', }); const newNs = await import('../fixtures/es-modules/tla/export-async.mjs'); if (ns === undefined) { diff --git a/test/es-module/test-require-module-tla-retry-require.js b/test/es-module/test-require-module-tla-retry-require.js index d440698fc22b52..f198e618dbab4c 100644 --- a/test/es-module/test-require-module-tla-retry-require.js +++ b/test/es-module/test-require-module-tla-retry-require.js @@ -7,10 +7,10 @@ const assert = require('assert'); assert.throws(() => { require('../fixtures/es-modules/tla/resolved.mjs'); }, { - code: 'ERR_REQUIRE_ASYNC_MODULE' + code: 'ERR_REQUIRE_ASYNC_MODULE', }); assert.throws(() => { require('../fixtures/es-modules/tla/resolved.mjs'); }, { - code: 'ERR_REQUIRE_ASYNC_MODULE' + code: 'ERR_REQUIRE_ASYNC_MODULE', }); diff --git a/test/es-module/test-require-module-warning.js b/test/es-module/test-require-module-warning.js index 4c651efd5c0cc7..08a0e8d75d8c76 100644 --- a/test/es-module/test-require-module-warning.js +++ b/test/es-module/test-require-module-warning.js @@ -30,7 +30,7 @@ spawnSyncAndAssert(process.execPath, [ lines[3], /at Object\. \(.*require-module\.js:1:1\)/ ); - } + }, }); spawnSyncAndAssert(process.execPath, [ @@ -39,5 +39,5 @@ spawnSyncAndAssert(process.execPath, [ ], { status: 9, trim: true, - stderr: /invalid value for --trace-require-module/ + stderr: /invalid value for --trace-require-module/, }); diff --git a/test/es-module/test-require-module.js b/test/es-module/test-require-module.js index 7e05fbd4a5bf88..4a675bc116c6eb 100644 --- a/test/es-module/test-require-module.js +++ b/test/es-module/test-require-module.js @@ -43,6 +43,6 @@ const assert = require('assert'); const mod = require('../fixtures/es-modules/data-import.mjs'); common.expectRequiredModule(mod, { data: { hello: 'world' }, - id: 'data:text/javascript,export default %7B%20hello%3A%20%22world%22%20%7D' + id: 'data:text/javascript,export default %7B%20hello%3A%20%22world%22%20%7D', }); } diff --git a/test/es-module/test-vm-main-context-default-loader.js b/test/es-module/test-vm-main-context-default-loader.js index d2ac6021df3837..a46cbd1d486b0c 100644 --- a/test/es-module/test-vm-main-context-default-loader.js +++ b/test/es-module/test-vm-main-context-default-loader.js @@ -77,7 +77,7 @@ async function main() { const filename = tmpdir.resolve('index.js'); const options = { filename, - importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER + importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER, }; await testNotFoundErrors(options); await testLoader(options); @@ -90,7 +90,7 @@ async function main() { const filename = url.pathToFileURL(tmpdir.resolve('index.js')).href + '?t=1'; const options = { filename, - importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER + importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER, }; await testNotFoundErrors(options); await testLoader(options); @@ -101,11 +101,11 @@ async function main() { tmpdir.refresh(); process.chdir(tmpdir.path); const undefinedOptions = { - importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER + importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER, }; const nonPathOptions = { filename: 'non-path', - importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER + importModuleDynamically: USE_MAIN_CONTEXT_DEFAULT_LOADER, }; // Run the error tests first to avoid caching. await testNotFoundErrors(undefinedOptions); diff --git a/test/es-module/test-wasm-web-api.js b/test/es-module/test-wasm-web-api.js index a6943254d88d83..ee1971133be5ea 100644 --- a/test/es-module/test-wasm-web-api.js +++ b/test/es-module/test-wasm-web-api.js @@ -74,7 +74,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { return assert.rejects(() => WebAssembly.compileStreaming(arg), { name: 'TypeError', code: 'ERR_INVALID_ARG_TYPE', - message: /^The "source" argument .*$/ + message: /^The "source" argument .*$/, }); }, 2)); } @@ -98,7 +98,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { await testCompileStreamingSuccess(() => { return Promise.resolve(new Response(simpleWasmBytes, { status: 200, - headers: { 'Content-Type': 'application/wasm' } + headers: { 'Content-Type': 'application/wasm' }, })); }); @@ -111,7 +111,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { const stream = handle.readableWebStream({ autoClose: true }); return Promise.resolve(new Response(stream, { status: 200, - headers: { 'Content-Type': 'application/wasm' } + headers: { 'Content-Type': 'application/wasm' }, })); }); @@ -161,7 +161,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { name: 'TypeError', code: 'ERR_WEBASSEMBLY_RESPONSE', message: 'WebAssembly response has unsupported MIME type ' + - "'application/wasm;'" + "'application/wasm;'", }); // A valid WebAssembly file with an invalid MIME type. @@ -172,7 +172,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { name: 'TypeError', code: 'ERR_WEBASSEMBLY_RESPONSE', message: 'WebAssembly response has unsupported MIME type ' + - "'application/octet-stream'" + "'application/octet-stream'", }); // HTTP status code indicating an error. @@ -183,7 +183,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { }, { name: 'TypeError', code: 'ERR_WEBASSEMBLY_RESPONSE', - message: /^WebAssembly response has status code 418$/ + message: /^WebAssembly response has status code 418$/, }); // HTTP status code indicating an error, but using a Response whose body is @@ -191,7 +191,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { await testCompileStreamingSuccess(() => { return Promise.resolve(new Response(simpleWasmBytes, { status: 200, - headers: { 'Content-Type': 'application/wasm' } + headers: { 'Content-Type': 'application/wasm' }, })); }); @@ -201,7 +201,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { res.end(Buffer.concat([simpleWasmBytes, Buffer.from('foo')])); }, { name: 'CompileError', - message: /^WebAssembly\.compileStreaming\(\): .*$/ + message: /^WebAssembly\.compileStreaming\(\): .*$/, }); // Missing bytes at the end of the WebAssembly file. @@ -210,7 +210,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { res.end(simpleWasmBytes.subarray(0, simpleWasmBytes.length - 3)); }, { name: 'CompileError', - message: /^WebAssembly\.compileStreaming\(\): .*$/ + message: /^WebAssembly\.compileStreaming\(\): .*$/, }); // Incomplete HTTP response body. The TypeError might come as a surprise, but @@ -223,7 +223,7 @@ function testCompileStreamingRejectionUsingFetch(responseCallback, rejection) { })); }, { name: 'TypeError', - message: /terminated/ + message: /terminated/, }); // Test "Developer-Facing Display Conventions" described in the WebAssembly diff --git a/test/eslint.config_partial.mjs b/test/eslint.config_partial.mjs index e1c728e3b9b362..a18f99625499b3 100644 --- a/test/eslint.config_partial.mjs +++ b/test/eslint.config_partial.mjs @@ -146,9 +146,7 @@ export default [ }, { files: [ - 'test/es-module/**/*.{js,mjs}', 'test/parallel/**/*.{js,mjs}', - 'test/sequential/**/*.{js,mjs}', ], rules: { '@stylistic/js/comma-dangle': [ @@ -163,6 +161,24 @@ export default [ ], }, }, + { + files: [ + 'test/es-module/**/*.{js,mjs}', + 'test/sequential/**/*.{js,mjs}', + ], + rules: { + '@stylistic/js/comma-dangle': [ + 'error', + { + arrays: 'always-multiline', + exports: 'always-multiline', + functions: 'only-multiline', + imports: 'always-multiline', + objects: 'always-multiline', + }, + ], + }, + }, { files: [ 'test/{common,fixtures,wpt}/**/*.{js,mjs,cjs}', diff --git a/test/parallel/test-util-getcallsites-preparestacktrace.js b/test/parallel/test-util-getcallsites-preparestacktrace.js new file mode 100644 index 00000000000000..ce4ac23e096a08 --- /dev/null +++ b/test/parallel/test-util-getcallsites-preparestacktrace.js @@ -0,0 +1,14 @@ +'use strict'; + +const common = require('../common'); +const assert = require('node:assert'); +const { getCallSites } = require('node:util'); + +// Asserts that util.getCallSites() does not invoke +// Error.prepareStackTrace. + +Error.prepareStackTrace = common.mustNotCall(); + +const sites = getCallSites(1); +assert.strictEqual(sites.length, 1); +assert.strictEqual(sites[0].scriptName, __filename); diff --git a/test/parallel/test-whatwg-writablestream.js b/test/parallel/test-whatwg-writablestream.js index 19dfa5fa79f4b3..88d9c57b9de752 100644 --- a/test/parallel/test-whatwg-writablestream.js +++ b/test/parallel/test-whatwg-writablestream.js @@ -4,6 +4,8 @@ const common = require('../common'); const assert = require('assert'); +const { isErrored, isWritable } = require('stream'); + const { WritableStream, WritableStreamDefaultController, @@ -171,6 +173,27 @@ class Sink { })); } +{ + const stream = new WritableStream(); + assert.strictEqual(isWritable(stream), true); + stream.close().then(common.mustCall(() => { + assert.strictEqual(isWritable(stream), false); + })); +} + +{ + const stream = new WritableStream({ + write: common.mustCall((chunk, controller) => { + controller.error(new Error()); + }) + }); + const writer = stream.getWriter(); + assert.strictEqual(isErrored(stream), false); + writer.write().then(common.mustCall(() => { + assert.strictEqual(isErrored(stream), true); + })); +} + { assert.throws(() => Reflect.get(WritableStream.prototype, 'locked', {}), { code: 'ERR_INVALID_THIS', diff --git a/test/sequential/test-child-process-execsync.js b/test/sequential/test-child-process-execsync.js index ed7f78d421112f..a7f28b79f453e8 100644 --- a/test/sequential/test-child-process-execsync.js +++ b/test/sequential/test-child-process-execsync.js @@ -156,5 +156,5 @@ const args = [ // Verify the shell option works properly execFileSync(`"${common.isWindows ? process.execPath : '$NODE'}"`, [], { - encoding: 'utf8', shell: true, env + encoding: 'utf8', shell: true, env, }); diff --git a/test/sequential/test-child-process-exit.js b/test/sequential/test-child-process-exit.js index 318b6451dd4e30..54dc6c1c90f984 100644 --- a/test/sequential/test-child-process-exit.js +++ b/test/sequential/test-child-process-exit.js @@ -40,7 +40,7 @@ if (gen === maxGen) { } const child = ch.spawn(process.execPath, [__filename, gen + 1], { - stdio: [ 'ignore', 'pipe', 'ignore' ] + stdio: [ 'ignore', 'pipe', 'ignore' ], }); assert.ok(!child.stdin); assert.ok(child.stdout); diff --git a/test/sequential/test-cli-syntax-require.js b/test/sequential/test-cli-syntax-require.js index 5572379f15bc97..f35ad90e00a5ea 100644 --- a/test/sequential/test-cli-syntax-require.js +++ b/test/sequential/test-cli-syntax-require.js @@ -28,7 +28,7 @@ const syntaxErrorRE = /^SyntaxError: \b/m; // stderr should include the filename assert(output.startsWith(file), `${output} starts with ${file}`); - } + }, }); }); }); diff --git a/test/sequential/test-cluster-inspect-brk.js b/test/sequential/test-cluster-inspect-brk.js index fbae27f9ba4eb4..c512a3b0e958cb 100644 --- a/test/sequential/test-cluster-inspect-brk.js +++ b/test/sequential/test-cluster-inspect-brk.js @@ -14,7 +14,7 @@ if (cluster.isPrimary) { cluster.setupPrimary({ execArgv: execArgv, - stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'] + stdio: ['pipe', 'pipe', 'pipe', 'ipc', 'pipe'], }); const worker = cluster.fork(); diff --git a/test/sequential/test-cpu-prof-default.js b/test/sequential/test-cpu-prof-default.js index 12c4bc05bb9c3c..efd929469a6a32 100644 --- a/test/sequential/test-cpu-prof-default.js +++ b/test/sequential/test-cpu-prof-default.js @@ -15,7 +15,7 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const { getCpuProfiles, - env + env, } = require('../common/cpu-prof'); { @@ -25,7 +25,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-absolute.js b/test/sequential/test-cpu-prof-dir-absolute.js index 03d7f50865b650..1747ba3b1f1123 100644 --- a/test/sequential/test-cpu-prof-dir-absolute.js +++ b/test/sequential/test-cpu-prof-dir-absolute.js @@ -15,7 +15,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // relative --cpu-prof-dir @@ -31,7 +31,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-and-name.js b/test/sequential/test-cpu-prof-dir-and-name.js index 84af5d8212065d..17395e678f35fc 100644 --- a/test/sequential/test-cpu-prof-dir-and-name.js +++ b/test/sequential/test-cpu-prof-dir-and-name.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -34,7 +34,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-relative.js b/test/sequential/test-cpu-prof-dir-relative.js index ac8c46486feae5..89684ae1c24b73 100644 --- a/test/sequential/test-cpu-prof-dir-relative.js +++ b/test/sequential/test-cpu-prof-dir-relative.js @@ -15,7 +15,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // relative --cpu-prof-dir @@ -30,7 +30,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-dir-worker.js b/test/sequential/test-cpu-prof-dir-worker.js index 22c7f79deb2fca..dd827414c5fe83 100644 --- a/test/sequential/test-cpu-prof-dir-worker.js +++ b/test/sequential/test-cpu-prof-dir-worker.js @@ -15,7 +15,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - getFrames + getFrames, } = require('../common/cpu-prof'); // --cpu-prof-dir with worker @@ -30,7 +30,7 @@ const { fixtures.path('workload', 'fibonacci-worker.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-drained.js b/test/sequential/test-cpu-prof-drained.js index 5be4d1a919eec0..d71255a6a75fb5 100644 --- a/test/sequential/test-cpu-prof-drained.js +++ b/test/sequential/test-cpu-prof-drained.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -28,7 +28,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-exit.js b/test/sequential/test-cpu-prof-exit.js index 34b1acff4b8f99..403af352dfeea5 100644 --- a/test/sequential/test-cpu-prof-exit.js +++ b/test/sequential/test-cpu-prof-exit.js @@ -15,7 +15,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -27,7 +27,7 @@ const { fixtures.path('workload', 'fibonacci-exit.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 55) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-cpu-prof-invalid-options.js b/test/sequential/test-cpu-prof-invalid-options.js index d63716941f78cf..5106dea6f7ba17 100644 --- a/test/sequential/test-cpu-prof-invalid-options.js +++ b/test/sequential/test-cpu-prof-invalid-options.js @@ -12,7 +12,7 @@ const { spawnSync } = require('child_process'); const tmpdir = require('../common/tmpdir'); const { kCpuProfInterval, - env + env, } = require('../common/cpu-prof'); // --cpu-prof-name without --cpu-prof @@ -24,7 +24,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { @@ -45,7 +45,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { @@ -66,7 +66,7 @@ for (const arg of [kCpuProfInterval, 'crashme']) { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); const stderr = output.stderr.toString().trim(); if (output.status !== 9) { diff --git a/test/sequential/test-cpu-prof-kill.js b/test/sequential/test-cpu-prof-kill.js index cee66a62569bc8..8d37e7fbfa53b2 100644 --- a/test/sequential/test-cpu-prof-kill.js +++ b/test/sequential/test-cpu-prof-kill.js @@ -15,7 +15,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -27,7 +27,7 @@ const { fixtures.path('workload', 'fibonacci-sigint.js'), ], { cwd: tmpdir.path, - env + env, }); if (!common.isWindows) { if (output.signal !== 'SIGINT') { diff --git a/test/sequential/test-cpu-prof-name.js b/test/sequential/test-cpu-prof-name.js index f40e639e92f624..f79c3af8eedae9 100644 --- a/test/sequential/test-cpu-prof-name.js +++ b/test/sequential/test-cpu-prof-name.js @@ -17,7 +17,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // --cpu-prof-name @@ -33,7 +33,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -60,7 +60,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: dir, - env + env, }); if (output.status !== 0) { diff --git a/test/sequential/test-cpu-prof-worker-argv.js b/test/sequential/test-cpu-prof-worker-argv.js index ad88a2eeb08f0d..37af0b95b7ea42 100644 --- a/test/sequential/test-cpu-prof-worker-argv.js +++ b/test/sequential/test-cpu-prof-worker-argv.js @@ -14,7 +14,7 @@ const tmpdir = require('../common/tmpdir'); const { getCpuProfiles, kCpuProfInterval, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); { @@ -25,8 +25,8 @@ const { cwd: tmpdir.path, env: { ...process.env, - CPU_PROF_INTERVAL: kCpuProfInterval - } + CPU_PROF_INTERVAL: kCpuProfInterval, + }, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-crypto-timing-safe-equal.js b/test/sequential/test-crypto-timing-safe-equal.js index 74ae39fbafcd0c..2025291daa0ffc 100644 --- a/test/sequential/test-crypto-timing-safe-equal.js +++ b/test/sequential/test-crypto-timing-safe-equal.js @@ -51,20 +51,20 @@ assert.strictEqual( test(new Float32Array([NaN]), new Float32Array([NaN]), { equal: false, sameValue: true, - timingSafeEqual: true + timingSafeEqual: true, }); test(new Float64Array([0]), new Float64Array([-0]), { equal: true, sameValue: false, - timingSafeEqual: false + timingSafeEqual: false, }); const x = new BigInt64Array([0x7ff0000000000001n, 0xfff0000000000001n]); test(new Float64Array(x.buffer), new Float64Array([NaN, NaN]), { equal: false, sameValue: true, - timingSafeEqual: false + timingSafeEqual: false, }); } @@ -73,7 +73,7 @@ assert.throws( { code: 'ERR_CRYPTO_TIMING_SAFE_EQUAL_LENGTH', name: 'RangeError', - message: 'Input buffers must have the same byte length' + message: 'Input buffers must have the same byte length', } ); diff --git a/test/sequential/test-diagnostic-dir-cpu-prof.js b/test/sequential/test-diagnostic-dir-cpu-prof.js index 75f1d86ef4b2b5..cb98a92eaf4037 100644 --- a/test/sequential/test-diagnostic-dir-cpu-prof.js +++ b/test/sequential/test-diagnostic-dir-cpu-prof.js @@ -16,7 +16,7 @@ const { getCpuProfiles, kCpuProfInterval, env, - verifyFrames + verifyFrames, } = require('../common/cpu-prof'); // Test --diagnostic-dir changes the default for --cpu-prof @@ -33,7 +33,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -62,7 +62,7 @@ const { fixtures.path('workload', 'fibonacci.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-diagnostic-dir-heap-prof.js b/test/sequential/test-diagnostic-dir-heap-prof.js index c74c075724185d..ad08f3463bc779 100644 --- a/test/sequential/test-diagnostic-dir-heap-prof.js +++ b/test/sequential/test-diagnostic-dir-heap-prof.js @@ -53,7 +53,7 @@ const TEST_ALLOCATION = kHeapProfInterval * 2; const env = { ...process.env, TEST_ALLOCATION, - NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER' + NODE_DEBUG_NATIVE: 'INSPECTOR_PROFILER', }; function getHeapProfiles(dir) { @@ -76,7 +76,7 @@ function getHeapProfiles(dir) { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); @@ -104,7 +104,7 @@ function getHeapProfiles(dir) { fixtures.path('workload', 'allocation.js'), ], { cwd: tmpdir.path, - env + env, }); if (output.status !== 0) { console.log(output.stderr.toString()); diff --git a/test/sequential/test-error-serdes.js b/test/sequential/test-error-serdes.js index 1a4ec1592bdc81..acd08903efab54 100644 --- a/test/sequential/test-error-serdes.js +++ b/test/sequential/test-error-serdes.js @@ -126,7 +126,7 @@ const data = { foo: 'bar', [inspect.custom]() { return 'barbaz'; - } + }, }; assert.strictEqual(inspect(cycle(data)), 'barbaz'); diff --git a/test/sequential/test-gc-http-client-onerror.js b/test/sequential/test-gc-http-client-onerror.js index 95e65ae0db6721..1c311c6a9b64a3 100644 --- a/test/sequential/test-gc-http-client-onerror.js +++ b/test/sequential/test-gc-http-client-onerror.js @@ -37,7 +37,7 @@ function getAll(requestsRemaining) { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb).on('error', onerror); count++; diff --git a/test/sequential/test-gc-http-client-timeout.js b/test/sequential/test-gc-http-client-timeout.js index e88578e765a7c7..bd5589fca1098f 100644 --- a/test/sequential/test-gc-http-client-timeout.js +++ b/test/sequential/test-gc-http-client-timeout.js @@ -30,7 +30,7 @@ function getAll(requestsRemaining) { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb); req.setTimeout(10, common.mustCall()); diff --git a/test/sequential/test-gc-http-client.js b/test/sequential/test-gc-http-client.js index b072d2c179b0e8..6b2a5fc03afbf3 100644 --- a/test/sequential/test-gc-http-client.js +++ b/test/sequential/test-gc-http-client.js @@ -35,7 +35,7 @@ function getAll(requestsRemaining) { const req = http.get({ hostname: 'localhost', pathname: '/', - port: server.address().port + port: server.address().port, }, cb); count++; diff --git a/test/sequential/test-get-heapsnapshot-options.js b/test/sequential/test-get-heapsnapshot-options.js index 91ba6112722ed5..96862ac367a72a 100644 --- a/test/sequential/test-get-heapsnapshot-options.js +++ b/test/sequential/test-get-heapsnapshot-options.js @@ -29,7 +29,7 @@ for (let i = 0; i < tests.cases.length; ++i) { process.execPath, ['--expose-internals', __filename, 'child', i + ''], { - cwd: tmpdir.path + cwd: tmpdir.path, }); const stderr = child.stderr.toString(); const stdout = child.stdout.toString(); diff --git a/test/sequential/test-heapdump.js b/test/sequential/test-heapdump.js index 013da83125313c..55b14ff9478a7d 100644 --- a/test/sequential/test-heapdump.js +++ b/test/sequential/test-heapdump.js @@ -46,7 +46,7 @@ process.chdir(tmpdir.path); name: 'TypeError', message: 'The "path" argument must be of type string or an instance of ' + 'Buffer or URL.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), }); }); @@ -55,7 +55,7 @@ process.chdir(tmpdir.path); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), }); }); @@ -64,7 +64,7 @@ process.chdir(tmpdir.path); code: 'ERR_INVALID_ARG_TYPE', name: 'TypeError', message: 'The "options" argument must be of type object.' + - common.invalidArgTypeHelper(i) + common.invalidArgTypeHelper(i), }); }); diff --git a/test/sequential/test-http-econnrefused.js b/test/sequential/test-http-econnrefused.js index e326357a51f3d7..9c4f0b48531da5 100644 --- a/test/sequential/test-http-econnrefused.js +++ b/test/sequential/test-http-econnrefused.js @@ -106,7 +106,7 @@ function ping() { const opt = { port: common.PORT, path: '/ping', - method: 'POST' + method: 'POST', }; const req = http.request(opt, common.mustCallAtLeast((res) => { diff --git a/test/sequential/test-http-keep-alive-large-write.js b/test/sequential/test-http-keep-alive-large-write.js index 18079ab133f08f..68dc4927cf50f6 100644 --- a/test/sequential/test-http-keep-alive-large-write.js +++ b/test/sequential/test-http-keep-alive-large-write.js @@ -17,7 +17,7 @@ const server = http.createServer(common.mustCall((req, res) => { res.writeHead(200, { 'Content-Type': 'application/octet-stream', 'Content-Length': content.length.toString(), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }); socket = res.socket; @@ -36,7 +36,7 @@ server.on('timeout', common.mustCallAtLeast(() => { server.listen(0, common.mustCall(() => { http.get({ path: '/', - port: server.address().port + port: server.address().port, }, (res) => { res.once('data', () => { socket._onTimeout(); diff --git a/test/sequential/test-http-keepalive-maxsockets.js b/test/sequential/test-http-keepalive-maxsockets.js index a9775e88ad8972..a999c9c127e07d 100644 --- a/test/sequential/test-http-keepalive-maxsockets.js +++ b/test/sequential/test-http-keepalive-maxsockets.js @@ -37,7 +37,7 @@ server.listen(0, common.mustCall(() => { const agent = http.Agent({ keepAlive: true, maxSockets: 5, - maxFreeSockets: 2 + maxFreeSockets: 2, }); let closed = false; @@ -83,7 +83,7 @@ server.listen(0, common.mustCall(() => { http.request({ port: server.address().port, path: `/${i}`, - agent: agent + agent: agent, }, common.mustCall((res) => { let data = ''; res.setEncoding('ascii'); diff --git a/test/sequential/test-http-server-keep-alive-timeout-slow-server.js b/test/sequential/test-http-server-keep-alive-timeout-slow-server.js index 1543c1415fa5e9..547aac9ff935ca 100644 --- a/test/sequential/test-http-server-keep-alive-timeout-slow-server.js +++ b/test/sequential/test-http-server-keep-alive-timeout-slow-server.js @@ -18,7 +18,7 @@ server.keepAliveTimeout = common.platformTimeout(200); const agent = new http.Agent({ keepAlive: true, - maxSockets: 1 + maxSockets: 1, }); function request(path, callback) { diff --git a/test/sequential/test-http-server-request-timeouts-mixed.js b/test/sequential/test-http-server-request-timeouts-mixed.js index 17b17e671d8709..034aa3630bbf69 100644 --- a/test/sequential/test-http-server-request-timeouts-mixed.js +++ b/test/sequential/test-http-server-request-timeouts-mixed.js @@ -21,7 +21,7 @@ const server = createServer({ headersTimeout, requestTimeout: headersTimeout * 2, keepAliveTimeout: 0, - connectionsCheckingInterval + connectionsCheckingInterval, }, common.mustCall((req, res) => { req.resume(); @@ -40,7 +40,7 @@ function createClient(server) { index: i++, client: connect(server.address().port), response: '', - completed: false + completed: false, }; request.client.setEncoding('utf8'); diff --git a/test/sequential/test-http2-max-session-memory.js b/test/sequential/test-http2-max-session-memory.js index 229bd7374458f9..51560b31299d41 100644 --- a/test/sequential/test-http2-max-session-memory.js +++ b/test/sequential/test-http2-max-session-memory.js @@ -34,7 +34,7 @@ server.listen(0, common.mustCall(() => { req.on('error', common.expectsError({ code: 'ERR_HTTP2_STREAM_ERROR', name: 'Error', - message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM' + message: 'Stream closed with error code NGHTTP2_ENHANCE_YOUR_CALM', })); req.on('close', common.mustCall(() => { server.close(); diff --git a/test/sequential/test-http2-timeout-large-write-file.js b/test/sequential/test-http2-timeout-large-write-file.js index 15c7d9f0ae104a..c0675ced2c1326 100644 --- a/test/sequential/test-http2-timeout-large-write-file.js +++ b/test/sequential/test-http2-timeout-large-write-file.js @@ -36,13 +36,13 @@ process.on('beforeExit', () => fs.closeSync(fd)); const server = http2.createSecureServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }); server.on('stream', common.mustCall((stream) => { stream.respondWithFD(fd, { 'Content-Type': 'application/octet-stream', 'Content-Length': content.length.toString(), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }); stream.end(); })); diff --git a/test/sequential/test-http2-timeout-large-write.js b/test/sequential/test-http2-timeout-large-write.js index 9f21042d88ca5b..ea5fd1973b71be 100644 --- a/test/sequential/test-http2-timeout-large-write.js +++ b/test/sequential/test-http2-timeout-large-write.js @@ -26,7 +26,7 @@ let didReceiveData = false; const server = http2.createSecureServer({ key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }); const onTimeout = common.mustCallAtLeast(() => { assert.ok(!didReceiveData, 'Should not timeout'); @@ -37,7 +37,7 @@ server.on('stream', common.mustCall((stream) => { stream.respond({ 'Content-Type': 'application/octet-stream', 'Content-Length': content.length.toString(), - 'Vary': 'Accept-Encoding' + 'Vary': 'Accept-Encoding', }); stream.write(content); diff --git a/test/sequential/test-https-server-keep-alive-timeout.js b/test/sequential/test-https-server-keep-alive-timeout.js index 5ded520dc7aaf8..d0e29ad28500dc 100644 --- a/test/sequential/test-https-server-keep-alive-timeout.js +++ b/test/sequential/test-https-server-keep-alive-timeout.js @@ -13,7 +13,7 @@ const tests = []; const serverOptions = { key: fixtures.readKey('agent1-key.pem'), - cert: fixtures.readKey('agent1-cert.pem') + cert: fixtures.readKey('agent1-cert.pem'), }; function test(fn) { @@ -45,7 +45,7 @@ test(function serverKeepAliveTimeoutWithPipeline(cb) { const options = { port: server.address().port, allowHalfOpen: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); @@ -68,7 +68,7 @@ test(function serverNoEndKeepAliveTimeoutWithPipeline(cb) { const options = { port: server.address().port, allowHalfOpen: true, - rejectUnauthorized: false + rejectUnauthorized: false, }; const c = tls.connect(options, () => { c.write('GET /1 HTTP/1.1\r\nHost: localhost\r\n\r\n'); diff --git a/test/sequential/test-inspector-port-cluster.js b/test/sequential/test-inspector-port-cluster.js index 510249b739dfb7..de5484e8c5e784 100644 --- a/test/sequential/test-inspector-port-cluster.js +++ b/test/sequential/test-inspector-port-cluster.js @@ -20,7 +20,7 @@ let offset = 0; function testRunnerMain() { let defaultPortCase = spawnPrimary({ execArgv: ['--inspect'], - workers: [{ expectedPort: 9230 }] + workers: [{ expectedPort: 9230 }], }); spawnPrimary({ @@ -30,7 +30,7 @@ function testRunnerMain() { { expectedPort: 1024 }, { expectedPort: 1025 }, { expectedPort: 1026 }, - ] + ], }); let port = debuggerPort + offset++ * 5; @@ -41,35 +41,35 @@ function testRunnerMain() { { expectedPort: port + 1 }, { expectedPort: port + 2 }, { expectedPort: port + 3 }, - ] + ], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: ['--inspect', `--inspect-port=${port}`], - workers: [{ expectedPort: port + 1 }] + workers: [{ expectedPort: port + 1 }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: ['--inspect', `--debug-port=${port}`], - workers: [{ expectedPort: port + 1 }] + workers: [{ expectedPort: port + 1 }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: [`--inspect=0.0.0.0:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '0.0.0.0' }] + workers: [{ expectedPort: port + 1, expectedHost: '0.0.0.0' }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: [`--inspect=127.0.0.1:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '127.0.0.1' }] + workers: [{ expectedPort: port + 1, expectedHost: '127.0.0.1' }], }); if (common.hasIPv6) { @@ -77,14 +77,14 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=[::]:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '::' }] + workers: [{ expectedPort: port + 1, expectedHost: '::' }], }); port = debuggerPort + offset++ * 5; spawnPrimary({ execArgv: [`--inspect=[::1]:${port}`], - workers: [{ expectedPort: port + 1, expectedHost: '::1' }] + workers: [{ expectedPort: port + 1, expectedHost: '::1' }], }); } @@ -96,7 +96,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: port + 2 }, - workers: [{ expectedPort: port + 2 }] + workers: [{ expectedPort: port + 2 }], }); port = debuggerPort + offset++ * 5; @@ -107,7 +107,7 @@ function testRunnerMain() { workers: [ { expectedPort: port + 2 }, { expectedPort: port + 4 }, - ] + ], }); port = debuggerPort + offset++ * 5; @@ -115,7 +115,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'string' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -123,7 +123,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'null' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -131,7 +131,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'bignumber' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -139,7 +139,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'negativenumber' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -147,7 +147,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'bignumberfunc' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -155,7 +155,7 @@ function testRunnerMain() { spawnPrimary({ execArgv: [`--inspect=${port}`], clusterSettings: { inspectPort: 'strfunc' }, - workers: [{}] + workers: [{}], }); port = debuggerPort + offset++ * 5; @@ -165,7 +165,7 @@ function testRunnerMain() { clusterSettings: { inspectPort: port, execArgv: ['--inspect'] }, workers: [ { expectedPort: port }, - ] + ], }); port = debuggerPort + offset++ * 5; @@ -177,7 +177,7 @@ function testRunnerMain() { { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, - ] + ], }); port = debuggerPort + offset++ * 5; @@ -189,7 +189,7 @@ function testRunnerMain() { { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, { expectedInitialPort: 0 }, - ] + ], }); defaultPortCase.then(() => { @@ -199,7 +199,7 @@ function testRunnerMain() { clusterSettings: { inspectPort: port + 2 }, workers: [ { expectedInitialPort: port + 2 }, - ] + ], }); }); } @@ -331,7 +331,7 @@ function spawnPrimary({ execArgv, workers, clusterSettings = {} }) { workers: JSON.stringify(workers), clusterSettings: JSON.stringify(clusterSettings), testProcess: true }, - execArgv: execArgv.concat(['--expose-internals']) + execArgv: execArgv.concat(['--expose-internals']), }).on('exit', common.mustCall((code, signal) => { checkExitCode(code, signal); resolve(); diff --git a/test/sequential/test-module-loading.js b/test/sequential/test-module-loading.js index b4f2d2633074f2..1e2efc6fd26a6b 100644 --- a/test/sequential/test-module-loading.js +++ b/test/sequential/test-module-loading.js @@ -122,7 +122,7 @@ assert.throws( code: 'MODULE_NOT_FOUND', message: /packages[/\\]missing-main-no-index[/\\]doesnotexist\.js'\. Please.+package\.json.+valid "main"/, path: /fixtures[/\\]packages[/\\]missing-main-no-index[/\\]package\.json/, - requestPath: /^\.\.[/\\]fixtures[/\\]packages[/\\]missing-main-no-index$/ + requestPath: /^\.\.[/\\]fixtures[/\\]packages[/\\]missing-main-no-index$/, } ); @@ -181,7 +181,7 @@ assert.strictEqual(require('../fixtures/registerExt.hello.world').test, console.error('load custom file types that return non-strings'); require.extensions['.test'] = function(module) { module.exports = { - custom: 'passed' + custom: 'passed', }; }; @@ -256,7 +256,7 @@ assert.throws( assert.deepStrictEqual(json, { name: 'package-name', version: '1.2.3', - main: 'package-main-module' + main: 'package-main-module', }); } @@ -278,21 +278,21 @@ assert.throws( assert.deepStrictEqual(children, { 'common/index.js': { - 'common/tmpdir.js': {} + 'common/tmpdir.js': {}, }, 'fixtures/not-main-module.js': {}, 'fixtures/a.js': { 'fixtures/b/c.js': { 'fixtures/b/d.js': {}, - 'fixtures/b/package/index.js': {} - } + 'fixtures/b/package/index.js': {}, + }, }, 'fixtures/foo': {}, 'fixtures/nested-index/one/index.js': { - 'fixtures/nested-index/one/hello.js': {} + 'fixtures/nested-index/one/hello.js': {}, }, 'fixtures/nested-index/two/index.js': { - 'fixtures/nested-index/two/hello.js': {} + 'fixtures/nested-index/two/hello.js': {}, }, 'fixtures/nested-index/three.js': {}, 'fixtures/nested-index/three/index.js': {}, @@ -301,13 +301,13 @@ assert.throws( 'fixtures/packages/main-index/package-main-module/index.js': {}, 'fixtures/packages/missing-main/index.js': {}, 'fixtures/cycles/root.js': { - 'fixtures/cycles/folder/foo.js': {} + 'fixtures/cycles/folder/foo.js': {}, }, 'fixtures/node_modules/foo.js': { 'fixtures/node_modules/baz/index.js': { 'fixtures/node_modules/bar.js': {}, - 'fixtures/node_modules/baz/node_modules/asdf.js': {} - } + 'fixtures/node_modules/baz/node_modules/asdf.js': {}, + }, }, 'fixtures/path.js': {}, 'fixtures/registerExt.test': {}, @@ -322,10 +322,10 @@ assert.throws( 'fixtures/module-load-order/file9/index.reg2': {}, 'fixtures/module-require/parent/index.js': { 'fixtures/module-require/child/index.js': { - 'fixtures/module-require/child/node_modules/target.js': {} - } + 'fixtures/module-require/child/node_modules/target.js': {}, + }, }, - 'fixtures/packages/main/package.json': {} + 'fixtures/packages/main/package.json': {}, }); } diff --git a/test/sequential/test-net-GH-5504.js b/test/sequential/test-net-GH-5504.js index ebe987d0443b6c..3bdd76b6260f8e 100644 --- a/test/sequential/test-net-GH-5504.js +++ b/test/sequential/test-net-GH-5504.js @@ -61,7 +61,7 @@ function client() { const net = require('net'); const client = net.connect({ host: common.localhostIPv4, - port: common.PORT + port: common.PORT, }, function() { client.destroy(); }); @@ -73,8 +73,8 @@ function parent() { const s = spawn(node, [__filename, 'server'], { env: Object.assign(process.env, { - NODE_DEBUG: 'net' - }) + NODE_DEBUG: 'net', + }), }); wrap(s.stderr, process.stderr, 'SERVER 2>'); diff --git a/test/sequential/test-net-connect-local-error.js b/test/sequential/test-net-connect-local-error.js index 6169c14989bd87..c18903001dd6e6 100644 --- a/test/sequential/test-net-connect-local-error.js +++ b/test/sequential/test-net-connect-local-error.js @@ -11,7 +11,7 @@ const optionsIPv4 = { port: common.PORT, family: 4, localPort: common.PORT + 1, - localAddress: common.localhostIPv4 + localAddress: common.localhostIPv4, }; const optionsIPv6 = { diff --git a/test/sequential/test-net-listen-shared-ports.js b/test/sequential/test-net-listen-shared-ports.js index e902d5387d6915..34091cba15cac6 100644 --- a/test/sequential/test-net-listen-shared-ports.js +++ b/test/sequential/test-net-listen-shared-ports.js @@ -55,7 +55,7 @@ if (cluster.isPrimary) { server1.listen({ host: 'localhost', port: common.PORT, - exclusive: false + exclusive: false, }, common.mustCall(function() { server2.listen({ port: common.PORT + 1, exclusive: true }, common.mustCall(function() { diff --git a/test/sequential/test-next-tick-error-spin.js b/test/sequential/test-next-tick-error-spin.js index 071a017877217a..d3ee6dbd01c6d8 100644 --- a/test/sequential/test-next-tick-error-spin.js +++ b/test/sequential/test-next-tick-error-spin.js @@ -26,7 +26,7 @@ const assert = require('assert'); if (process.argv[2] !== 'child') { const spawn = require('child_process').spawn; const child = spawn(process.execPath, [__filename, 'child'], { - stdio: 'pipe'// 'inherit' + stdio: 'pipe', // 'inherit' }); const timer = setTimeout(function() { throw new Error('child is hung'); diff --git a/test/sequential/test-performance-eventloopdelay.js b/test/sequential/test-performance-eventloopdelay.js index 0d38300d7b3a15..c6d8dba51c0bcc 100644 --- a/test/sequential/test-performance-eventloopdelay.js +++ b/test/sequential/test-performance-eventloopdelay.js @@ -5,7 +5,7 @@ const common = require('../common'); const assert = require('assert'); const os = require('os'); const { - monitorEventLoopDelay + monitorEventLoopDelay, } = require('perf_hooks'); const { sleep } = require('internal/util'); @@ -25,7 +25,7 @@ const { sleep } = require('internal/util'); () => monitorEventLoopDelay(i), { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); @@ -35,7 +35,7 @@ const { sleep } = require('internal/util'); () => monitorEventLoopDelay({ resolution: i }), { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); @@ -45,7 +45,7 @@ const { sleep } = require('internal/util'); () => monitorEventLoopDelay({ resolution: i }), { name: 'RangeError', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', } ); }); @@ -87,7 +87,7 @@ const { sleep } = require('internal/util'); () => histogram.percentile(i), { name: 'TypeError', - code: 'ERR_INVALID_ARG_TYPE' + code: 'ERR_INVALID_ARG_TYPE', } ); }); @@ -96,7 +96,7 @@ const { sleep } = require('internal/util'); () => histogram.percentile(i), { name: 'RangeError', - code: 'ERR_OUT_OF_RANGE' + code: 'ERR_OUT_OF_RANGE', } ); }); diff --git a/test/sequential/test-pipe.js b/test/sequential/test-pipe.js index 4defd4628e37c9..7515e4c705b08f 100644 --- a/test/sequential/test-pipe.js +++ b/test/sequential/test-pipe.js @@ -93,7 +93,7 @@ function startClient() { port: common.PORT, method: 'GET', path: '/', - headers: { 'content-length': buffer.length } + headers: { 'content-length': buffer.length }, }, common.mustCall((res) => { res.setEncoding('utf8'); res.on('data', common.mustCall((string) => { diff --git a/test/sequential/test-repl-timeout-throw.js b/test/sequential/test-repl-timeout-throw.js index d8f1df9564e49f..fcebf762647fbf 100644 --- a/test/sequential/test-repl-timeout-throw.js +++ b/test/sequential/test-repl-timeout-throw.js @@ -5,7 +5,7 @@ const assert = require('assert'); const spawn = require('child_process').spawn; const child = spawn(process.execPath, [ '-i' ], { - stdio: [null, null, 2] + stdio: [null, null, 2], }); let stdout = ''; diff --git a/test/sequential/test-runner-run-inspect.mjs b/test/sequential/test-runner-run-inspect.mjs index 35c380c8d4e33e..959c20f880aa32 100644 --- a/test/sequential/test-runner-run-inspect.mjs +++ b/test/sequential/test-runner-run-inspect.mjs @@ -15,7 +15,7 @@ async function spawnRunner({ execArgv, expectedPort, expectedHost, expectedIniti expectedPort, inspectPort, expectedHost, - expectedInitialPort } + expectedInitialPort }, }); assert.strictEqual(code, 0); assert.strictEqual(signal, null); @@ -65,7 +65,7 @@ port = debuggerPort + offset++ * 5; await spawnRunner({ execArgv: [`--inspect=127.0.0.1:${port}`], - expectedPort: port + 1, expectedHost: '127.0.0.1' + expectedPort: port + 1, expectedHost: '127.0.0.1', }); if (common.hasIPv6) { @@ -73,14 +73,14 @@ if (common.hasIPv6) { await spawnRunner({ execArgv: [`--inspect=[::]:${port}`], - expectedPort: port + 1, expectedHost: '::' + expectedPort: port + 1, expectedHost: '::', }); port = debuggerPort + offset++ * 5; await spawnRunner({ execArgv: [`--inspect=[::1]:${port}`], - expectedPort: port + 1, expectedHost: '::1' + expectedPort: port + 1, expectedHost: '::1', }); } @@ -136,7 +136,7 @@ port = debuggerPort + offset++ * 5; await spawnRunner({ execArgv: [`--inspect=${port}`], - inspectPort: 'bignumberfunc' + inspectPort: 'bignumberfunc', }); port = debuggerPort + offset++ * 5; diff --git a/test/sequential/test-tls-connect.js b/test/sequential/test-tls-connect.js index 5cfec7ed04707d..189b9afa6352bb 100644 --- a/test/sequential/test-tls-connect.js +++ b/test/sequential/test-tls-connect.js @@ -55,7 +55,7 @@ const tls = require('tls'); cert: cert, key: key, port: common.PORT, - ciphers: 'rick-128-roll' + ciphers: 'rick-128-roll', }, common.mustNotCall()); }, /no cipher match/i); } diff --git a/test/sequential/test-tls-lookup.js b/test/sequential/test-tls-lookup.js index dba39c17ab7b31..4b123a97629936 100644 --- a/test/sequential/test-tls-lookup.js +++ b/test/sequential/test-tls-lookup.js @@ -10,14 +10,14 @@ const tls = require('tls'); const opts = { host: 'localhost', port: common.PORT, - lookup: input + lookup: input, }; assert.throws(() => { tls.connect(opts); }, { code: 'ERR_INVALID_ARG_TYPE', - name: 'TypeError' + name: 'TypeError', }); }); @@ -27,7 +27,7 @@ function connectDoesNotThrow(input) { const opts = { host: 'localhost', port: common.PORT, - lookup: input + lookup: input, }; tls.connect(opts); diff --git a/test/sequential/test-tls-psk-client.js b/test/sequential/test-tls-psk-client.js index c9a904e729b830..65e628a6f4e0eb 100644 --- a/test/sequential/test-tls-psk-client.js +++ b/test/sequential/test-tls-psk-client.js @@ -94,10 +94,10 @@ function runClient(message, cb) { if (hint === null || hint === IDENTITY) { return { identity: IDENTITY, - psk: Buffer.from(KEY, 'hex') + psk: Buffer.from(KEY, 'hex'), }; } - } + }, }); s.on('secureConnect', common.mustCall(() => { let data = ''; diff --git a/test/sequential/test-tls-session-timeout.js b/test/sequential/test-tls-session-timeout.js index 44e8d537fc0bfc..79298fc1abbee2 100644 --- a/test/sequential/test-tls-session-timeout.js +++ b/test/sequential/test-tls-session-timeout.js @@ -83,7 +83,7 @@ function doTest() { flags.push('-sess_out', sessOut); } const client = spawn(opensslCli, flags, { - stdio: ['ignore', 'pipe', 'inherit'] + stdio: ['ignore', 'pipe', 'inherit'], }); let clientOutput = ''; diff --git a/test/sequential/test-util-debug.js b/test/sequential/test-util-debug.js index be7feda51e267b..f6c4fbd1273691 100644 --- a/test/sequential/test-util-debug.js +++ b/test/sequential/test-util-debug.js @@ -63,8 +63,8 @@ function test(environ, shouldWrite, section, forceColors = false) { const child = spawn(process.execPath, [__filename, 'child', section], { env: Object.assign(process.env, { NODE_DEBUG: environ, - FORCE_COLOR: forceColors ? 'true' : 'false' - }) + FORCE_COLOR: forceColors ? 'true' : 'false', + }), }); if (shouldWrite) { @@ -114,7 +114,7 @@ function child(section) { const tty = require('tty'); // Make sure we check for colors, no matter of the stream's default. Object.defineProperty(process.stderr, 'hasColors', { - value: tty.WriteStream.prototype.hasColors + value: tty.WriteStream.prototype.hasColors, }); let innerDebug = null; diff --git a/test/sequential/test-vm-timeout-escape-promise-module-2.js b/test/sequential/test-vm-timeout-escape-promise-module-2.js index 13aa2fe998655d..503395bec7f94a 100644 --- a/test/sequential/test-vm-timeout-escape-promise-module-2.js +++ b/test/sequential/test-vm-timeout-escape-promise-module-2.js @@ -31,12 +31,12 @@ assert.rejects(async () => { { context: vm.createContext({ hrtime, - loop - }, { microtaskMode: 'afterEvaluate' }) + loop, + }, { microtaskMode: 'afterEvaluate' }), }); await module.link(common.mustNotCall()); await module.evaluate({ timeout: 10 }); }, { code: 'ERR_SCRIPT_EXECUTION_TIMEOUT', - message: 'Script execution timed out after 10ms' + message: 'Script execution timed out after 10ms', }).then(common.mustCall()); diff --git a/test/sequential/test-watch-mode-inspect.mjs b/test/sequential/test-watch-mode-inspect.mjs index a04ba474f6a47f..f2886f11b56da4 100644 --- a/test/sequential/test-watch-mode-inspect.mjs +++ b/test/sequential/test-watch-mode-inspect.mjs @@ -22,7 +22,7 @@ async function getDebuggedPid(instance, waitForLog = true) { await session.waitForConsoleOutput('log', 'safe to debug now'); } const { value: innerPid } = (await session.send({ - 'method': 'Runtime.evaluate', 'params': { 'expression': 'process.pid' } + 'method': 'Runtime.evaluate', 'params': { 'expression': 'process.pid' }, })).result; session.disconnect(); gettingDebuggedPid = false; diff --git a/test/sequential/test-watch-mode-watch-flags.mjs b/test/sequential/test-watch-mode-watch-flags.mjs index 8cd08ee08a4c0e..385f381ad6a0ed 100644 --- a/test/sequential/test-watch-mode-watch-flags.mjs +++ b/test/sequential/test-watch-mode-watch-flags.mjs @@ -63,7 +63,7 @@ describe('watch mode - watch flags', { concurrency: !process.env.TEST_PARALLEL, );`, '.js', projectDir); const args = ['--watch', '--watch', file]; const { stdout, stderr } = await runNode({ - file, args, options: { cwd: projectDir } + file, args, options: { cwd: projectDir }, }); assert.strictEqual(stderr, ''); @@ -85,7 +85,7 @@ describe('watch mode - watch flags', { concurrency: !process.env.TEST_PARALLEL, );`, '.js', projectDir); const args = ['--watch', `--watch-path`, file, file]; const { stdout, stderr } = await runNode({ - file, args, options: { cwd: projectDir } + file, args, options: { cwd: projectDir }, }); assert.strictEqual(stderr, ''); diff --git a/test/sequential/test-watch-mode.mjs b/test/sequential/test-watch-mode.mjs index dc7ccf6cf6d2e7..b9e57cb30bedc9 100644 --- a/test/sequential/test-watch-mode.mjs +++ b/test/sequential/test-watch-mode.mjs @@ -86,7 +86,7 @@ function runInBackground({ args = [], options = {}, completed = 'Completed runni return future.promise.finally(() => { clearTimeout(timer); }); - } + }, }; } @@ -98,7 +98,7 @@ async function runWriteSucceed({ completed = 'Completed running', restarts = 2, options = {}, - shouldFail = false + shouldFail = false, }) { args.unshift('--no-warnings'); if (watchFlag !== null) args.unshift(watchFlag); @@ -165,7 +165,7 @@ describe('watch mode', { concurrency: !process.env.TEST_PARALLEL, timeout: 60_00 it('should watch changes to a file', async () => { const file = createTmpFile(); const { stderr, stdout } = await runWriteSucceed({ file, watchedFile: file, watchFlag: '--watch=true', options: { - timeout: 10000 + timeout: 10000, } }); assert.strictEqual(stderr, ''); @@ -274,7 +274,7 @@ describe('watch mode', { concurrency: !process.env.TEST_PARALLEL, timeout: 60_00 file, watchedFile: file, completed: 'Failed running', - shouldFail: true + shouldFail: true, }); assert.match(stderr, /Error: fails\r?\n/); @@ -307,7 +307,7 @@ describe('watch mode', { concurrency: !process.env.TEST_PARALLEL, timeout: 60_00 }); it('should watch when running an non-existing file - when specified under --watch-path', { - skip: !supportsRecursive + skip: !supportsRecursive, }, async () => { const dir = tmpdir.resolve('subdir2'); mkdirSync(dir); @@ -319,7 +319,7 @@ describe('watch mode', { concurrency: !process.env.TEST_PARALLEL, timeout: 60_00 watchedFile, args, completed: 'Failed running', - shouldFail: true + shouldFail: true, }); assert.match(stderr, /Error: Cannot find module/g); @@ -331,7 +331,7 @@ describe('watch mode', { concurrency: !process.env.TEST_PARALLEL, timeout: 60_00 }); it('should watch when running an non-existing file - when specified under --watch-path with equals', { - skip: !supportsRecursive + skip: !supportsRecursive, }, async () => { const dir = tmpdir.resolve('subdir3'); mkdirSync(dir); @@ -343,7 +343,7 @@ describe('watch mode', { concurrency: !process.env.TEST_PARALLEL, timeout: 60_00 watchedFile, args, completed: 'Failed running', - shouldFail: true + shouldFail: true, }); assert.match(stderr, /Error: Cannot find module/g); @@ -481,21 +481,21 @@ console.log(values.random); // TODO: Remove skip after https://github.com/nodejs/node/pull/45271 lands it('should not watch when running an missing file', { - skip: !supportsRecursive + skip: !supportsRecursive, }, async () => { const nonExistingfile = tmpdir.resolve(`${tmpFiles++}.js`); await failWriteSucceed({ file: nonExistingfile, watchedFile: nonExistingfile }); }); it('should not watch when running an missing mjs file', { - skip: !supportsRecursive + skip: !supportsRecursive, }, async () => { const nonExistingfile = tmpdir.resolve(`${tmpFiles++}.mjs`); await failWriteSucceed({ file: nonExistingfile, watchedFile: nonExistingfile }); }); it('should watch changes to previously missing dependency', { - skip: !supportsRecursive + skip: !supportsRecursive, }, async () => { const dependency = tmpdir.resolve(`${tmpFiles++}.js`); const relativeDependencyPath = `./${path.basename(dependency)}`; @@ -505,7 +505,7 @@ console.log(values.random); }); it('should watch changes to previously missing ESM dependency', { - skip: !supportsRecursive + skip: !supportsRecursive, }, async () => { const relativeDependencyPath = `./${tmpFiles++}.mjs`; const dependency = tmpdir.resolve(relativeDependencyPath); @@ -559,8 +559,8 @@ console.log(values.random); const args = [`--watch-path=${dir}`, '--require', './some.js', file]; const { stdout, stderr } = await runWriteSucceed({ file, watchedFile, args, options: { - cwd: projectDir - } + cwd: projectDir, + }, }); assert.strictEqual(stderr, ''); @@ -591,8 +591,8 @@ console.log(values.random); const args = [`--watch-path=${dir}`, '--require=./some.js', file]; const { stdout, stderr } = await runWriteSucceed({ file, watchedFile, args, options: { - cwd: projectDir - } + cwd: projectDir, + }, }); assert.strictEqual(stderr, ''); @@ -623,8 +623,8 @@ console.log(values.random); const args = ['--watch-path', `${dir}`, '--require', './some.js', file]; const { stdout, stderr } = await runWriteSucceed({ file, watchedFile, args, options: { - cwd: projectDir - } + cwd: projectDir, + }, }); assert.strictEqual(stderr, ''); @@ -655,8 +655,8 @@ console.log(values.random); const args = ['--watch-path', `${dir}`, '--require=./some.js', file]; const { stdout, stderr } = await runWriteSucceed({ file, watchedFile, args, options: { - cwd: projectDir - } + cwd: projectDir, + }, }); assert.strictEqual(stderr, ''); @@ -697,7 +697,7 @@ console.log(values.random); const file = createTmpFile("console.log('running');", '.js', projectDir); const args = ['--watch', '-r', './some.js', file]; const { stdout, stderr } = await runWriteSucceed({ - file, watchedFile: file, watchFlag: null, args, options: { cwd: projectDir } + file, watchedFile: file, watchFlag: null, args, options: { cwd: projectDir }, }); assert.strictEqual(stderr, ''); @@ -797,8 +797,8 @@ process.on('message', (message) => { const configFile = createTmpFile(JSON.stringify({ watch: { 'watch': true } }), '.json'); const { stderr, stdout } = await runWriteSucceed({ file, watchedFile: file, args: ['--experimental-config-file', configFile, file], options: { - timeout: 10000 - } + timeout: 10000, + }, }); assert.strictEqual(stderr, ''); @@ -847,8 +847,8 @@ process.on('message', (message) => { args: ['--experimental-default-config-file', file], options: { timeout: 10000, - cwd: dir - } + cwd: dir, + }, }); assert.strictEqual(stderr, ''); @@ -868,7 +868,7 @@ process.on('message', (message) => { const envFileA = createTmpFile(`${envKey}=123`, '.env'); const envFileB = createTmpFile(`${envKey2}=456`, '.env'); const { done, restart } = runInBackground({ - args: ['--watch', `--env-file=${envFileA}`, `--env-file=${envFileB}`, jsFile] + args: ['--watch', `--env-file=${envFileA}`, `--env-file=${envFileB}`, jsFile], }); try { diff --git a/test/sequential/test-worker-fshandles-error-on-termination.js b/test/sequential/test-worker-fshandles-error-on-termination.js index ada99a991bcc97..e7438c0cc7b263 100644 --- a/test/sequential/test-worker-fshandles-error-on-termination.js +++ b/test/sequential/test-worker-fshandles-error-on-termination.js @@ -35,7 +35,7 @@ if (!process.env.HAS_STARTED_WORKER) { fs.open('this file does not exist'), { code: 'ENOENT', - syscall: 'open' + syscall: 'open', } ); await scheduler.yield(); diff --git a/test/sequential/test-worker-prof.js b/test/sequential/test-worker-prof.js index c04b4646a045db..a3cf4f26ff252e 100644 --- a/test/sequential/test-worker-prof.js +++ b/test/sequential/test-worker-prof.js @@ -64,7 +64,7 @@ if (process.argv[2] === 'child') { assert.match(output, workerProfRegexp); assert.match(output, parentProfRegexp); return true; - } + }, }); const workerProf = stdout.match(workerProfRegexp)[1]; const parentProf = stdout.match(parentProfRegexp)[1]; diff --git a/test/sequential/test-write-heapsnapshot-options.js b/test/sequential/test-write-heapsnapshot-options.js index cc3b4b19f4d724..dca3cfebfc8df5 100644 --- a/test/sequential/test-write-heapsnapshot-options.js +++ b/test/sequential/test-write-heapsnapshot-options.js @@ -40,7 +40,7 @@ for (let i = 0; i < tests.cases.length; ++i) { process.execPath, ['--expose-internals', __filename, 'child', i + ''], { - cwd: tmpdir.path + cwd: tmpdir.path, }); const stderr = child.stderr.toString(); const stdout = child.stdout.toString();