From 6f1d4b4b78e3bf74342c000a0a1f846cffa62638 Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 24 Oct 2025 14:20:04 -0700 Subject: [PATCH 1/2] chore: move to node:test --- .github/workflows/ci.yml | 8 +++++--- package.json | 16 ++++++---------- test/index.js | 7 ++++--- 3 files changed, 15 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fcfdb200..443bdbde 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -85,7 +85,9 @@ 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 + - name: Test (with coverage on Node >= 24) + if: ${{ startsWith(matrix.node-version, '24') }} + run: npm run test:cover --ignore-scripts + - name: Test (without coverage on Node < 24) + if: ${{ !startsWith(matrix.node-version, '24') }} run: npm test --ignore-scripts diff --git a/package.json b/package.json index 772848ff..eb1b4579 100644 --- a/package.json +++ b/package.json @@ -9,10 +9,11 @@ "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: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", @@ -48,13 +49,8 @@ ".github/ISSUE_TEMPLATE/bug.yml": false, ".commitlintrc.js": false } - } - }, - "tap": { - "nyc-arg": [ - "--exclude", - "tap-snapshots/**" - ] + }, + "testRunner": "node:test" }, "devDependencies": { "@npmcli/eslint-config": "^6.0.0", diff --git a/test/index.js b/test/index.js index f311fc50..3966a29b 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,7 @@ -const t = require('tap') +const t = require('node:test') +const a = require('node:assert') -t.test('no tests yet', async t => { +t.test('no tests yet', async () => { // TODO: test for formatting, etc in RFCs? - t.ok(1) + a.ok(1) }) From 04b97447f09523fc4fc9397aaa4f66899cd75cfd Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Fri, 24 Oct 2025 14:20:22 -0700 Subject: [PATCH 2/2] chore: remove tap --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index eb1b4579..2f048ea8 100644 --- a/package.json +++ b/package.json @@ -54,7 +54,6 @@ }, "devDependencies": { "@npmcli/eslint-config": "^6.0.0", - "@npmcli/template-oss": "4.27.1", - "tap": "^16.3.2" + "@npmcli/template-oss": "4.27.1" } }