import assert from "node:assert/strict"; import test from "node:test"; test("a frame no view reads invalidates nothing", async () => { const { resourcesForTopic } = await import("../src/stores/live-events.ts"); assert.deepEqual(resourcesForTopic("work"), ["work"]); assert.deepEqual(resourcesForTopic("log"), []); }); test("a closed stream is retried with doubling delay, capped at 30s", async () => { const { reconnectDelay } = await import("../src/lib/stream-state.ts"); assert.deepEqual( [0, 1, 2, 3, 4, 5, 6, 10].map(reconnectDelay), [1000, 2000, 4000, 8000, 16000, 30000, 30000, 30000], ); });