-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
73bc6c5
commit a27e31c
Showing
3 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
const test = require('ava'); | ||
const jwt = require('jsonwebtoken'); | ||
const _ = require('lodash'); | ||
|
||
const config = require('../../../config'); | ||
|
||
const utils = require('../../utils'); | ||
|
||
const rootUrl = '/v1/config'; | ||
|
||
test.before(async (t) => { | ||
await utils.setupApiServer(t); | ||
t.context.token = jwt.sign({}, config.jwt.secret); | ||
|
||
t.context.api = t.context.api.auth(t.context.token, { type: 'bearer' }); | ||
}); | ||
|
||
test('GET > successfully', async (t) => { | ||
const { api, bree } = t.context; | ||
|
||
const res = await api.get(rootUrl); | ||
|
||
t.is(res.status, 200); | ||
t.like(res.body, _.omit(bree.config, 'logger')); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters