Files
kandev/apps/web/lib/state/workspace-context.test.ts
T
2026-09-13 16:59:03 +01:00

14 lines
561 B
TypeScript

import { describe, expect, it } from "vitest";
import { retryAfterMilliseconds } from "./workspace-context";
describe("retryAfterMilliseconds", () => {
it("caps a server delay at the browser timer limit", () => {
expect(retryAfterMilliseconds({ retryAfterSeconds: 3_000_000 })).toBe(2_147_483_647);
});
it("rejects non-positive and non-finite delays", () => {
expect(retryAfterMilliseconds({ retryAfterSeconds: 0 })).toBeUndefined();
expect(retryAfterMilliseconds({ retryAfterSeconds: Number.POSITIVE_INFINITY })).toBeUndefined();
});
});