Files
speckle-server/packages/server/modules/core/tests/health.spec.ts
T
Iain Sproat 7e6f31ad66 chore(health): add dedicated liveness and readiness endpoints (#1987)
* 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
2024-06-18 12:49:03 +01:00

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)
})
})