Files
ln-bi/src/server/routes/health.test.ts
T

16 lines
557 B
TypeScript

import assert from 'node:assert/strict';
import test from 'node:test';
import app from './health.js';
test('separates liveness from configuration readiness', async () => {
const liveness = await app.request('/');
const readiness = await app.request('/readiness');
const liveBody = await liveness.json();
const readyBody = await readiness.json();
assert.equal(liveness.status, 200);
assert.equal(liveBody.semantics, 'liveness');
assert.equal(readyBody.semantics, 'configuration-only');
assert.ok([200, 503].includes(readiness.status));
});