cache queries and revalidate with incremental static regeneration

This commit is contained in:
2026-07-07 02:32:21 +02:00
parent d63b14b2e5
commit e600d0a663
22 changed files with 381 additions and 114 deletions
+24
View File
@@ -0,0 +1,24 @@
import assert from "node:assert/strict";
import { test } from "node:test";
import { secondsUntilOsloMidnight } from "./revalidation.ts";
test("normal day: 12:00 CEST is 12h from midnight", () => {
const now = new Date("2026-07-07T10:00:00Z");
assert.equal(secondsUntilOsloMidnight(now), 12 * 3600);
});
test("clamps to 60s just before midnight", () => {
const now = new Date("2026-07-07T21:59:30Z");
assert.equal(secondsUntilOsloMidnight(now), 60);
});
test("DST fall-back day is 25h (2026-10-25)", () => {
const now = new Date("2026-10-24T22:00:00Z");
assert.equal(secondsUntilOsloMidnight(now), 25 * 3600);
});
test("DST spring-forward day is 23h (2026-03-29)", () => {
const now = new Date("2026-03-28T23:00:00Z");
assert.equal(secondsUntilOsloMidnight(now), 23 * 3600);
});