Skip to content

feat(sdk): add withRetry utility, retry config, and test suite (#198 …#257

Merged
Tinna23 merged 2 commits intoStellarCommons:mainfrom
tolulopedd26:feat/sdk-tests-retry-coverage
Mar 29, 2026
Merged

feat(sdk): add withRetry utility, retry config, and test suite (#198 …#257
Tinna23 merged 2 commits intoStellarCommons:mainfrom
tolulopedd26:feat/sdk-tests-retry-coverage

Conversation

@tolulopedd26
Copy link
Copy Markdown
Contributor

#199 #200 #201)

  • Add withRetry with exponential backoff to src/utils/index.ts
  • Add retries / retryDelay config to StellarExplainClientConfig; wire into client via fetchJsonWithRetry; NotFoundError never retries
  • Add Stellar address validation to explainAccount (throws InvalidInputError)
  • Add vitest.config.ts with v8 coverage provider, text+html reporters, and 80/80/75 thresholds
  • Add test:coverage script and @vitest/coverage-v8 dev dependency
  • Exclude coverage/ in .gitignore
  • Add tests/retry.test.ts — unit tests for withRetry and client retry integration
  • Add tests/retry-timing.test.ts — fake-timer tests for exponential backoff delays
  • Add tests/error-messages.test.ts — snapshot tests for all error class messages

closes #198
closes #199
closes #200
closes #201

…arCommons#198 StellarCommons#199 StellarCommons#200 StellarCommons#201)

- Add `withRetry` with exponential backoff to `src/utils/index.ts`
- Add `retries` / `retryDelay` config to `StellarExplainClientConfig`; wire into client via `fetchJsonWithRetry`; `NotFoundError` never retries
- Add Stellar address validation to `explainAccount` (throws `InvalidInputError`)
- Add `vitest.config.ts` with v8 coverage provider, text+html reporters, and 80/80/75 thresholds
- Add `test:coverage` script and `@vitest/coverage-v8` dev dependency
- Exclude `coverage/` in `.gitignore`
- Add `tests/retry.test.ts` — unit tests for `withRetry` and client retry integration
- Add `tests/retry-timing.test.ts` — fake-timer tests for exponential backoff delays
- Add `tests/error-messages.test.ts` — snapshot tests for all error class messages
@drips-wave
Copy link
Copy Markdown

drips-wave bot commented Mar 29, 2026

@tolulopedd26 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Tinna23 Tinna23 merged commit ada257f into StellarCommons:main Mar 29, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants