diff --git a/.github/workflows/audit.yml b/.github/workflows/audit.yml index 85282bdf..2543d79b 100644 --- a/.github/workflows/audit.yml +++ b/.github/workflows/audit.yml @@ -30,8 +30,8 @@ jobs: uses: actions/setup-node@v4 id: node with: - node-version: 22.x - check-latest: contains('22.x', '.x') + node-version: 24.x + check-latest: contains('24.x', '.x') - name: Install Latest npm uses: ./.github/actions/install-latest-npm with: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcfdb200..7cd75319 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,8 +34,8 @@ jobs: uses: actions/setup-node@v4 id: node with: - node-version: 22.x - check-latest: contains('22.x', '.x') + node-version: 24.x + check-latest: contains('24.x', '.x') - name: Install Latest npm uses: ./.github/actions/install-latest-npm with: @@ -58,10 +58,11 @@ jobs: os: ubuntu-latest shell: bash node-version: - - 18.0.0 - - 18.x + - 20.17.0 - 20.x + - 22.9.0 - 22.x + - 24.x runs-on: ${{ matrix.platform.os }} defaults: run: @@ -85,7 +86,12 @@ jobs: node: ${{ steps.node.outputs.node-version }} - name: Install Dependencies run: npm i --ignore-scripts --no-audit --no-fund - - name: Add Problem Matcher - run: echo "::add-matcher::.github/matchers/tap.json" + - name: Test (with coverage on Node >= 24) + if: ${{ startsWith(matrix.node-version, '24') }} + run: npm run test:cover --ignore-scripts + - name: Test (on Node 20 with globbing workaround) + if: ${{ startsWith(matrix.node-version, '20') }} + run: npm run test:node20 --ignore-scripts - name: Test + if: ${{ !startsWith(matrix.node-version, '24') && !startsWith(matrix.node-version, '20') }} run: npm test --ignore-scripts diff --git a/.github/workflows/post-dependabot.yml b/.github/workflows/post-dependabot.yml index 3a919116..8e80d10d 100644 --- a/.github/workflows/post-dependabot.yml +++ b/.github/workflows/post-dependabot.yml @@ -28,8 +28,8 @@ jobs: uses: actions/setup-node@v4 id: node with: - node-version: 22.x - check-latest: contains('22.x', '.x') + node-version: 24.x + check-latest: contains('24.x', '.x') - name: Install Latest npm uses: ./.github/actions/install-latest-npm with: diff --git a/package.json b/package.json index 94300c34..480a4e64 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,12 @@ "postlint": "template-oss-check", "template-oss-apply": "template-oss-apply --force", "lintfix": "npm run eslint -- --fix", - "snap": "tap", - "test": "tap", + "snap": "node --test --test-update-snapshots './test/**/*.js'", + "test": "node --test './test/**/*.js'", "posttest": "npm run lint", - "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"" + "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"", + "test:node20": "node --test test", + "test:cover": "node --test --experimental-test-coverage --test-timeout=3000 --test-coverage-lines=100 --test-coverage-functions=100 --test-coverage-branches=100 './test/**/*.js'" }, "repository": { "type": "git", @@ -30,7 +32,7 @@ "lib/" ], "engines": { - "node": ">=18.0.0" + "node": "^20.17.0 || >=22.9.0" }, "templateOSS": { "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.", @@ -48,17 +50,12 @@ ".github/ISSUE_TEMPLATE/bug.yml": false, ".commitlintrc.js": false } - } - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] + }, + "testRunner": "node:test", + "latestCiVersion": 24 }, "devDependencies": { "@npmcli/eslint-config": "^6.0.0", - "@npmcli/template-oss": "4.28.1", - "tap": "^16.3.2" + "@npmcli/template-oss": "4.28.1" } } diff --git a/test/index.js b/test/index.js index f311fc50..93c66e55 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,7 @@ -const t = require('tap') +const { test } = require('node:test') +const assert = require('node:assert') -t.test('no tests yet', async t => { +test('no tests yet', async () => { // TODO: test for formatting, etc in RFCs? - t.ok(1) + assert.ok(1) })