From 454d5f26a36a872891e96df42fc0a276c693cb50 Mon Sep 17 00:00:00 2001 From: Sebastian Riedel Date: Thu, 21 Sep 2023 03:23:59 +0200 Subject: [PATCH] Switch to node --test --- .github/workflows/test.yml | 2 +- docs/Introduction.md | 2 +- package.json | 6 +++--- src/cli/create-full-app.ts | 4 ++-- src/cli/create-plugin.ts | 4 ++-- test/command-app.js | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1c055487..aa99f7b0 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -7,7 +7,7 @@ jobs: strategy: fail-fast: false matrix: - node-version: [16.x, 18.x, 20.x] + node-version: [18.x, 20.x] os: [ubuntu-latest, windows-latest, macos-latest] steps: - uses: actions/checkout@v1 diff --git a/docs/Introduction.md b/docs/Introduction.md index e0564b2d..05c9e446 100644 --- a/docs/Introduction.md +++ b/docs/Introduction.md @@ -1090,7 +1090,7 @@ And run your tests as scripts or with `tap`. ``` $ node test/basic.js -$ tap --no-coverage test/*.js +$ node --test test/*.js ``` For more information take a look at the [User-Agent](User-Agent.md) guide. diff --git a/package.json b/package.json index 49f838c5..507bd9b5 100644 --- a/package.json +++ b/package.json @@ -32,14 +32,14 @@ "build:test": "npm run build && npm test", "build:watch": "npm run build -- --watch", "clean": "rm -rf tsconfig.tsbuildinfo test/support/ts/full-app/tsconfig.tsbuildinfo lib test/support/ts/full-app/lib", - "coverage": "c8 tap --no-coverage test/*.js", - "coverage:ci": "c8 --reporter lcovonly tap --no-coverage test/*.js", + "coverage": "c8 node --test test/*.js", + "coverage:ci": "c8 --reporter lcovonly node --test test/*.js", "lint": "eslint \"test/*.js\" \"test/support/js/**/*.js\" \"test/support/ts/**/src/**/*.ts\" \"src/**/*.ts\" \"src/*.ts\"", "lint:fix": "npm run lint -- --fix", "prepublishOnly": "npm run build", "publish:minor": "npm version minor && npm publish", "publish:patch": "npm version patch && npm publish", - "test": "tap --no-coverage test/*.js" + "test": "node --test test/*.js" }, "exports": "./lib/core.js", "types": "./lib/core.d.ts", diff --git a/src/cli/create-full-app.ts b/src/cli/create-full-app.ts index 5fedee13..3fc42418 100644 --- a/src/cli/create-full-app.ts +++ b/src/cli/create-full-app.ts @@ -63,7 +63,7 @@ export default async function createFullAppCommand(app: App, args: string[]): Pr 'build:watch': 'npm run build -- --watch', dev: 'npx nodemon lib/index.js server', start: 'NODE_ENV=production node lib/index.js server -l http://*:8080', - test: 'tap --no-coverage test/*.js' + test: 'node --test test/*.js' } }); } @@ -86,7 +86,7 @@ export default async function createFullAppCommand(app: App, args: string[]): Pr scripts: { dev: 'npx nodemon index.js server', start: 'NODE_ENV=production node index.js server -l http://*:8080', - test: 'tap --no-coverage test/*.js' + test: 'node --test test/*.js' } }); } diff --git a/src/cli/create-plugin.ts b/src/cli/create-plugin.ts index 2b50be82..3113e2f8 100644 --- a/src/cli/create-plugin.ts +++ b/src/cli/create-plugin.ts @@ -64,7 +64,7 @@ export default async function createPluginCommand(app: App, args: string[]): Pro build: 'npx tsc --build ./', 'build:test': 'npm run build && npm test', 'build:watch': 'npm run build -- --watch', - test: 'tap --no-coverage test/*.js' + test: 'node --test test/*.js' } }); } @@ -77,7 +77,7 @@ export default async function createPluginCommand(app: App, args: string[]): Pro await util.cliFixPackage({ ...commonSettings, devDependencies: await util.devDependencies(/^tap$/), - scripts: {test: 'tap --no-coverage test/*.js'} + scripts: {test: 'node --test test/*.js'} }); } } diff --git a/test/command-app.js b/test/command-app.js index f125f907..fdc9a76b 100644 --- a/test/command-app.js +++ b/test/command-app.js @@ -405,7 +405,7 @@ t.test('Command app', async t => { t.equal(typeof pkg.scripts.start, 'string'); t.match(pkg.scripts.start, /node index\.js/); t.equal(typeof pkg.scripts.test, 'string'); - t.match(pkg.scripts.test, /tap/); + t.match(pkg.scripts.test, /node --test/); t.equal(typeof pkg.devDependencies['nodemon'], 'string'); t.equal(typeof pkg.devDependencies['tap'], 'string'); @@ -460,7 +460,7 @@ t.test('Command app', async t => { t.equal(typeof pkg2.scripts.start, 'string'); t.match(pkg2.scripts.start, /node lib\/index\.js/); t.equal(typeof pkg2.scripts.test, 'string'); - t.match(pkg2.scripts.test, /tap/); + t.match(pkg2.scripts.test, /node --test/); t.equal(typeof pkg2.devDependencies['@types/node'], 'string'); t.equal(typeof pkg2.devDependencies['nodemon'], 'string'); t.equal(typeof pkg2.devDependencies['tap'], 'string');