1
1
'use strict'
2
2
3
- const test = require ( 'tap' ) . test
3
+ const { test } = require ( 'node:test' )
4
4
const Fastify = require ( 'fastify' )
5
5
const jwt = require ( '../jwt' )
6
6
const { createSigner } = require ( 'fast-jwt' )
@@ -30,9 +30,8 @@ test('Async key provider should be resolved internally', async function (t) {
30
30
jwt : 'supersecret'
31
31
}
32
32
} )
33
- t . ok ( response )
34
- t . comment ( "Should be 'undefined'" )
35
- t . match ( response . json ( ) , { user : 'test' } )
33
+ t . assert . ok ( response )
34
+ t . assert . strictEqual ( response . json ( ) . user , 'test' )
36
35
} )
37
36
38
37
test ( 'Async key provider errors should be resolved internally' , async function ( t ) {
@@ -58,7 +57,7 @@ test('Async key provider errors should be resolved internally', async function (
58
57
url : '/'
59
58
} )
60
59
61
- t . equal ( response . statusCode , 401 )
60
+ t . assert . strictEqual ( response . statusCode , 401 )
62
61
} )
63
62
64
63
test ( 'Async key provider should be resolved internally with cache' , async function ( t ) {
@@ -96,8 +95,8 @@ test('Async key provider should be resolved internally with cache', async functi
96
95
method : 'get' ,
97
96
url : '/'
98
97
} )
99
- t . equal ( response . statusCode , 200 )
100
- t . match ( response . json ( ) , { name : 'John Doe' } )
98
+ t . assert . strictEqual ( response . statusCode , 200 )
99
+ t . assert . strictEqual ( response . json ( ) . name , 'John Doe' )
101
100
} )
102
101
103
102
test ( 'Async key provider errors should be resolved internally with cache' , async function ( t ) {
@@ -131,5 +130,5 @@ test('Async key provider errors should be resolved internally with cache', async
131
130
url : '/'
132
131
} )
133
132
134
- t . equal ( response . statusCode , 401 )
133
+ t . assert . strictEqual ( response . statusCode , 401 )
135
134
} )
0 commit comments