Skip to content

Commit

Permalink
Switch to node --test
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Sep 21, 2023
1 parent 2d6b897 commit 454d5f2
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion docs/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions src/cli/create-full-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
});
}
Expand All @@ -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'
}
});
}
Expand Down
4 changes: 2 additions & 2 deletions src/cli/create-plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
});
}
Expand All @@ -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'}
});
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/command-app.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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');
Expand Down

0 comments on commit 454d5f2

Please sign in to comment.