Input
GET /users → 200 with body { id: 1 }Output
Promise resolves to { id: 1 }A 200 response is parsed as JSON and returned directly.
You're writing tests for an `ApiClient` class — a reusable wrapper around `fetch` that handles errors, parses JSON, and retries transient server failures. The class is in `src/ApiClient.ts` — read-only. Your job is in `...
src/ApiClient.tsReference startertests/ApiClient.test.tsEditable testsGET /users → 200 with body { id: 1 }Promise resolves to { id: 1 }A 200 response is parsed as JSON and returned directly.
GET /not-found → 404
Promise rejects with Error('HTTP 404')Any non-ok status that isn't retried must throw with the status code.
The retry strategy here is a flat counter. Real systems use exponential backoff — each retry waits 2× longer than the last. How would you test that without making your test suite take seconds to run?