Retry.Test
Path:
_archive/loom-stale-pre-sprint-snapshot/tests/retry.test.tsRelative: loom-stale-pre-sprint-snapshot/tests/retry.test.tsSubproject: _archiveCategory: archivedLines: 66Bytes: 2,287Imports: 3Exports: 0has tests
Content Preview
- import { describe, expect, test } from "bun:test";
- import { withRetry } from "../src/lib/retry";
- import { RetryExhaustedError } from "../src/types/errors";
- const noSleep = (): Promise<void> => Promise.resolve();
- describe("withRetry — exponential backoff + full jitter (HC-6)", () => {
- test("succeeds after transient failures", async () => {
- let calls = 0;
- const result = await withRetry(
- "flaky",
- () => {
- calls++;
- return calls < 3 ? Promise.reject(new Error("t