add basic test for /health

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-12-20 22:30:14 +01:00
parent 10e763be00
commit 70b3d0edf4
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 26 additions and 0 deletions

26
test/app.js Normal file
View File

@ -0,0 +1,26 @@
import { expect } from 'chai'
import sinon from 'sinon'
import request from 'supertest'
import App from '../src/app'
import Builds from '../src/builds'
import Comments from '../src/comments'
let comments
let app
describe('App', () => {
beforeEach(() => {
comments = sinon.createStubInstance(Comments)
comments.db = sinon.createStubInstance(Builds),
app = App(comments)
})
describe('/health', () => {
it('should return OK', async () => {
let resp = await request(app.callback()).get('/health')
expect(resp.text).to.eq('OK')
expect(resp.status).to.eq(200)
})
})
})