@davoodmehraban89 / LifeMate / commits / 98847f6
Fork 0

LifeMate — Personal, Family & Learning Companion

test: target production entrypoint operational wrapper

davoodmehraban89 committed Oct 5, 2026 at 17:10 UTC 98847f6a581bcb81208a4101a02436a1507375a5
1 file changed +7 -5
backend/tests/operations_contract.test.js
+7 -5
@@ -3,7 +3,7 @@ import assert from 'node:assert/strict';
3 import fs from 'node:fs';
4
5 const operations = fs.readFileSync(new URL('../src/operations.js', import.meta.url), 'utf8');
6 -const server = fs.readFileSync(new URL('../src/server.js', import.meta.url), 'utf8');
6 +const entrypoint = fs.readFileSync(new URL('../src/entrypoint.js', import.meta.url), 'utf8');
7
8 test('operations layer provides correlation, safe telemetry and security headers', () => {
9 assert.match(operations, /x-request-id/i);
@@ -23,8 +23,10 @@ test('operations layer defines bounded rate-limit profiles and retry-after', ()
23 assert.match(operations, /rate_limited/);
24 });
25
26 -test('server exposes liveness and database readiness separately', () => {
27 - assert.match(server, /app\.get\('\/live'/);
28 - assert.match(server, /app\.get\('\/ready'/);
29 - assert.match(server, /select 1 as ok/);
26 +test('production entrypoint exposes liveness and database readiness separately', () => {
27 + assert.match(entrypoint, /outer\.get\('\/live'/);
28 + assert.match(entrypoint, /outer\.get\('\/ready'/);
29 + assert.match(entrypoint, /select 1 as ok/);
30 + assert.match(entrypoint, /requestContext/);
31 + assert.match(entrypoint, /rateLimit/);
32 });