7e6f31ad66
* chore(health): add dedicated liveness and readiness endpoints - provides more flexibility in defining what constitutes readiness and liveness * add tests for /liveness and /readiness * Prevent liveness and readiness endpoints being exposed externally by redirecting their routes
22 lines
596 B
TypeScript
22 lines
596 B
TypeScript
/* istanbul ignore file */
|
|
import { beforeEachContext } from '@/test/hooks'
|
|
import { expect } from 'chai'
|
|
import request from 'supertest'
|
|
|
|
describe('Health Routes @api-rest', () => {
|
|
let app: Express.Application
|
|
before(async () => {
|
|
;({ app } = await beforeEachContext())
|
|
})
|
|
|
|
it('Should response to liveness endpoint', async () => {
|
|
const res = await request(app).get('/liveness')
|
|
expect(res).to.have.status(200)
|
|
})
|
|
|
|
it('Should response to readiness endpoint', async () => {
|
|
const res = await request(app).get('/readiness')
|
|
expect(res).to.have.status(200)
|
|
})
|
|
})
|