mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
Add healtcheck unit test
This commit is contained in:
parent
af8822366b
commit
ed2f1a5d8d
37
unleash-server/test/routers.test.js
Normal file
37
unleash-server/test/routers.test.js
Normal file
@ -0,0 +1,37 @@
|
||||
var request = require('supertest'),
|
||||
mockery = require('mockery');
|
||||
|
||||
describe('The routes', function () {
|
||||
var server;
|
||||
|
||||
before(function () {
|
||||
mockery.enable({
|
||||
warnOnReplace: false,
|
||||
warnOnUnregistered: false,
|
||||
useCleanCache: true
|
||||
});
|
||||
|
||||
mockery.registerSubstitute('./eventDb', '../test/eventDbMock');
|
||||
mockery.registerSubstitute('./featureDb', '../test/featureDbMock');
|
||||
|
||||
server = require('../server');
|
||||
request = request('http://localhost:' + server.app.get('port'));
|
||||
});
|
||||
|
||||
after(function () {
|
||||
mockery.disable();
|
||||
mockery.deregisterAll();
|
||||
server.server.close();
|
||||
});
|
||||
|
||||
describe('healthcheck', function () {
|
||||
|
||||
it('returns health good', function (done) {
|
||||
request.get('/health')
|
||||
.expect('Content-Type', /json/)
|
||||
.expect(200)
|
||||
.expect('{"health":"GOOD"}', done);
|
||||
});
|
||||
});
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user