1
1
'use strict'
2
2
3
- const { test } = require ( 'tap ' )
3
+ const { test } = require ( 'node:test ' )
4
4
const Fastify = require ( '..' )
5
5
const {
6
6
FST_ERR_DEC_ALREADY_PRESENT
@@ -10,7 +10,7 @@ test('Should be able to override the default use API', t => {
10
10
t . plan ( 1 )
11
11
const fastify = Fastify ( )
12
12
fastify . decorate ( 'use' , ( ) => true )
13
- t . equal ( fastify . use ( ) , true )
13
+ t . assert . strictEqual ( fastify . use ( ) , true )
14
14
} )
15
15
16
16
test ( 'Cannot decorate use twice' , t => {
@@ -20,17 +20,16 @@ test('Cannot decorate use twice', t => {
20
20
try {
21
21
fastify . decorate ( 'use' , ( ) => true )
22
22
} catch ( err ) {
23
- t . ok ( err instanceof FST_ERR_DEC_ALREADY_PRESENT )
23
+ t . assert . ok ( err instanceof FST_ERR_DEC_ALREADY_PRESENT )
24
24
}
25
25
} )
26
26
27
27
test ( 'Encapsulation works' , t => {
28
- t . plan ( 1 )
29
28
const fastify = Fastify ( )
30
29
31
30
fastify . register ( ( instance , opts , done ) => {
32
31
instance . decorate ( 'use' , ( ) => true )
33
- t . equal ( instance . use ( ) , true )
32
+ t . assert . strictEqual ( instance . use ( ) , true )
34
33
done ( )
35
34
} )
36
35
0 commit comments