Files
speckle-server/packages/server/modules/core/tests/health.spec.ts
T
Iain Sproat 27a0600dcd feat(server): multi-region aware liveness and readiness checks (#3468)
* chore(healthchecks): refactor out of modules
* feat(server): multi-region aware liveness and readiness checks
* Add tests for redis & postgres healthchecks
* do not close Redis client after checking it is healthy, we now use a shared client
2024-12-11 09:29:53 +00:00

24 lines
701 B
TypeScript

/* istanbul ignore file */
import { ReadinessHandler } from '@/healthchecks/types'
import { beforeEachContext } from '@/test/hooks'
import { expect } from 'chai'
import request from 'supertest'
describe('Health Routes @api-rest', () => {
let app: Express.Application
let readinessCheck: ReadinessHandler
before(async () => {
;({ app, readinessCheck } = 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 readinessCheck()
expect(res).to.have.property('details')
})
})