import test from "node:test"; import assert from "node:assert/strict"; import { pollTimeoutMs } from "./usePolledPayload"; // The hook itself has no harness here (no DOM, no React renderer in the editor // unit suite); its hang recovery is the timeout below plus the rule that a // timed-out tick is a failed tick and schedules the next one. This pins the // number, so "serial polling can stall forever" cannot come back as a 0 or an // accidental per-interval timeout that misses every cold compile. test("a poll is abandoned after three intervals, never sooner than 10 s", () => { assert.equal(pollTimeoutMs(1_000), 10_000); assert.equal(pollTimeoutMs(3_000), 10_000); assert.equal(pollTimeoutMs(5_000), 15_000); assert.equal(pollTimeoutMs(15_000), 45_000); });