feat: expose BI configuration readiness

This commit is contained in:
kkfluous
2026-08-07 16:00:04 +08:00
parent 686fc4e2e2
commit 02d714175f
9 changed files with 167 additions and 4 deletions
+15
View File
@@ -0,0 +1,15 @@
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));
});