Address architecture + stability review (todo §0): wire buildContext, graceful shutdown, prod template caching

This commit is contained in:
2026-06-15 08:42:16 +02:00
parent 0bc7998cfe
commit 17f4411518
5 changed files with 37 additions and 4 deletions

View File

@@ -34,6 +34,22 @@ test("serves static CSS", async () => {
assert.match(res.headers.get("content-type") ?? "", /text\/css/);
});
// Production caches compiled templates; rendering must stay correct across repeated requests.
test("renders correctly with template caching enabled", async () => {
const app = createApp({ cache: true });
try {
await new Promise<void>((resolve) => app.listen(0, resolve));
const url = `http://localhost:${(app.address() as AddressInfo).port}/`;
for (let i = 0; i < 2; i++) {
const res = await fetch(url);
assert.equal(res.status, 200);
assert.match(await res.text(), /Plainpages/);
}
} finally {
app.close();
}
});
test("returns the 404 HTML page for unknown routes", async () => {
const res = await fetch(base + "/missing");
assert.equal(res.status, 404);