import { describe, expect, it } from "vitest"; import { normalizeAppSetupMaxRetries } from "../src/Utils/appSetupRetry"; describe("App setup retry mount option", () => { it("defaults to three retries and accepts zero or a custom count", () => { expect(normalizeAppSetupMaxRetries(undefined)).toBe(3); expect(normalizeAppSetupMaxRetries(0)).toBe(0); expect(normalizeAppSetupMaxRetries(4)).toBe(4); expect(normalizeAppSetupMaxRetries(17)).toBe(17); expect(10_000 * 2 ** 17).toBeLessThanOrEqual(0x7fffffff); expect(10_000 * 2 ** 18).toBeGreaterThan(0x7fffffff); }); it.each([-1, 1.5, NaN, Infinity, 18, null, "3"].map(value => [value]))( "rejects invalid counts or browser timer overflow: %s", value => { expect(() => normalizeAppSetupMaxRetries(value as number)).toThrow("appSetupMaxRetries"); } ); });