Skip to content

Commit 9b63607

Browse files
Tony133dancastilloclimba03003Uzlopak
authored
test: migrated middleware.test.js from tap to node:test (fastify#5795)
* test: migrated middleware.test.js from tap to node:test * test: improvement test Co-authored-by: Dan Castillo <[email protected]> Signed-off-by: Antonio Tripodi <[email protected]> * chore: update test middleware.test.js Co-authored-by: KaKa <[email protected]> Signed-off-by: Antonio Tripodi <[email protected]> --------- Signed-off-by: Antonio Tripodi <[email protected]> Co-authored-by: Dan Castillo <[email protected]> Co-authored-by: KaKa <[email protected]> Co-authored-by: Aras Abbasi <[email protected]>
1 parent fb169eb commit 9b63607

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

test/middleware.test.js

+4-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict'
22

3-
const { test } = require('tap')
3+
const { test } = require('node:test')
44
const Fastify = require('..')
55
const {
66
FST_ERR_DEC_ALREADY_PRESENT
@@ -10,7 +10,7 @@ test('Should be able to override the default use API', t => {
1010
t.plan(1)
1111
const fastify = Fastify()
1212
fastify.decorate('use', () => true)
13-
t.equal(fastify.use(), true)
13+
t.assert.strictEqual(fastify.use(), true)
1414
})
1515

1616
test('Cannot decorate use twice', t => {
@@ -20,17 +20,16 @@ test('Cannot decorate use twice', t => {
2020
try {
2121
fastify.decorate('use', () => true)
2222
} catch (err) {
23-
t.ok(err instanceof FST_ERR_DEC_ALREADY_PRESENT)
23+
t.assert.ok(err instanceof FST_ERR_DEC_ALREADY_PRESENT)
2424
}
2525
})
2626

2727
test('Encapsulation works', t => {
28-
t.plan(1)
2928
const fastify = Fastify()
3029

3130
fastify.register((instance, opts, done) => {
3231
instance.decorate('use', () => true)
33-
t.equal(instance.use(), true)
32+
t.assert.strictEqual(instance.use(), true)
3433
done()
3534
})
3635

0 commit comments

Comments
 (0)