Skip to content

Commit 1fd2dc5

Browse files
committed
add tests for extended boom raising
1 parent fdff582 commit 1fd2dc5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

test/utils.spec.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,17 @@ test('get boom error with default message', (t) => {
1010
}))
1111
})
1212

13+
test('get boom error with reason', (t) => {
14+
const result = utils.raiseUnauthorized(null, null, 'foobar')
15+
t.truthy(result)
16+
t.deepEqual(result, boom.unauthorized(undefined, 'Bearer', {
17+
strategy: 'keycloak-jwt',
18+
reason: 'foobar'
19+
}))
20+
})
21+
1322
test('get boom error with custom scheme', (t) => {
14-
const result = utils.raiseUnauthorized(null, null, 'custom')
23+
const result = utils.raiseUnauthorized(null, null, null, 'custom')
1524
t.truthy(result)
1625
t.deepEqual(result, boom.unauthorized(undefined, 'custom', {
1726
strategy: 'keycloak-jwt'

0 commit comments

Comments
 (0)