@@ -3,15 +3,15 @@ const test = require('ava')
3
3
const utils = require ( '../src/utils' )
4
4
5
5
test ( 'get boom error with default message' , ( t ) => {
6
- const result = utils . raiseUnauthorized ( )
6
+ const result = utils . raiseUnauthorized ( null , null , 'keycloak-jwt' )
7
7
t . truthy ( result )
8
8
t . deepEqual ( result , boom . unauthorized ( undefined , 'Bearer' , {
9
9
strategy : 'keycloak-jwt'
10
10
} ) )
11
11
} )
12
12
13
13
test ( 'get boom error with reason' , ( t ) => {
14
- const result = utils . raiseUnauthorized ( null , 'foobar' )
14
+ const result = utils . raiseUnauthorized ( null , 'foobar' , 'keycloak-jwt' )
15
15
t . truthy ( result )
16
16
t . deepEqual ( result , boom . unauthorized ( undefined , 'Bearer' , {
17
17
strategy : 'keycloak-jwt' ,
@@ -20,15 +20,15 @@ test('get boom error with reason', (t) => {
20
20
} )
21
21
22
22
test ( 'get boom error with custom scheme' , ( t ) => {
23
- const result = utils . raiseUnauthorized ( null , null , 'custom' )
23
+ const result = utils . raiseUnauthorized ( null , null , 'keycloak-jwt' , ' custom')
24
24
t . truthy ( result )
25
25
t . deepEqual ( result , boom . unauthorized ( undefined , 'custom' , {
26
26
strategy : 'keycloak-jwt'
27
27
} ) )
28
28
} )
29
29
30
30
test ( 'get boom error with error message' , ( t ) => {
31
- const result = utils . raiseUnauthorized ( 'foobar' )
31
+ const result = utils . raiseUnauthorized ( 'foobar' , null , 'keycloak-jwt' )
32
32
t . truthy ( result )
33
33
t . deepEqual ( result , boom . unauthorized ( 'foobar' , 'Bearer' , {
34
34
strategy : 'keycloak-jwt'
0 commit comments