Skip to content

Commit f55734c

Browse files
authored
fix(templates): remove obsolete .taprc file (#747)
1 parent 424afa7 commit f55734c

File tree

3 files changed

+10
-18
lines changed

3 files changed

+10
-18
lines changed

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ if your project uses `@fastify/swagger`, `fastify-cli` can generate and write ou
328328

329329
"scripts": {
330330
+ "pretest": "standard",
331-
"test": "tap test/**/*.test.js",
331+
"test": "node --test test/**/*.test.js",
332332
"start": "fastify start -l info app.js",
333333
"dev": "fastify start -l info -P app.js",
334334
+ "lint": "standard --fix"
@@ -339,7 +339,7 @@ if your project uses `@fastify/swagger`, `fastify-cli` can generate and write ou
339339

340340
When you use `fastify-cli` to run your project you need a way to load your application because you can run the CLI command.
341341
To do so, you can use the this module to load your application and give you the control to write your assertions.
342-
These utilities are async functions that you may use with the [`node-tap`](https://www.npmjs.com/package/tap) testing framework.
342+
These utilities are async functions that you may use with the [`Node Test runner`](https://nodejs.org/api/test.html).
343343

344344
There are two utilities provided:
345345

@@ -357,21 +357,23 @@ Both of these utilities have the `function(args, pluginOptions, serverOptions)`
357357
const { build, listen } = require('fastify-cli/helper')
358358

359359
// write a test
360-
const { test } = require('tap')
360+
const { test } = require('node:test')
361+
const assert = require('node:assert')
362+
361363
test('test my application', async t => {
362364
const argv = ['app.js']
363365
const app = await build(argv, {
364366
extraParam: 'foo'
365367
})
366-
t.teardown(() => app.close())
368+
t.after(() => app.close())
367369

368370
// test your application here:
369371
const res = await app.inject('/')
370-
t.same(res.json(), { hello: 'one' })
372+
assert.deepStrictEqual(res.json(), { hello: 'one' })
371373
})
372374
```
373375

374-
Log output is consumed by tap. If log messages should be logged to the console
376+
Log output is consumed by Node Test runner. If log messages should be logged to the console
375377
the logger needs to be configured to output to stderr instead of stdout.
376378

377379
```js
@@ -386,11 +388,11 @@ const logger = {
386388
const argv = ['app.js']
387389
test('test my application with logging enabled', async t => {
388390
const app = await build(argv, {}, { logger })
389-
t.teardown(() => app.close())
391+
t.after(() => app.close())
390392

391393
// test your application here:
392394
const res = await app.inject('/')
393-
t.same(res.json(), { hello: 'one' })
395+
assert.deepStrictEqual(res.json(), { hello: 'one' })
394396
})
395397
```
396398

templates/app-ts-esm/__taprc

Lines changed: 0 additions & 5 deletions
This file was deleted.

templates/app-ts/__taprc

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)