-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add test coverage to the healthcheck route
- Loading branch information
Mateu Aguiló Bosch
committed
May 28, 2018
1 parent
2c5e925
commit a1904c7
Showing
2 changed files
with
23 additions
and
0 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
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,22 @@ | ||
// @flow | ||
|
||
const healthcheck = require('./healthcheck'); | ||
|
||
describe('The healthcheck route', () => { | ||
test('It responds', () => { | ||
const res = { | ||
set: jest.fn(), | ||
json: jest.fn(), | ||
}; | ||
healthcheck(null, res); | ||
expect(res.set).toHaveBeenCalledWith( | ||
'Cache-Control', | ||
'private, max-age=0, no-cache' | ||
); | ||
expect(res.json).toHaveBeenCalledWith({ | ||
meta: { | ||
healthcheck: 'good', | ||
}, | ||
}); | ||
}); | ||
}); |