Skip to content

refactor: implementations and tests#5

Merged
SvenAlHamad merged 6 commits into
v3from
bruno/v3/refactor-implementations
Jun 3, 2026
Merged

refactor: implementations and tests#5
SvenAlHamad merged 6 commits into
v3from
bruno/v3/refactor-implementations

Conversation

@brunozoric

Copy link
Copy Markdown
Collaborator

Refactor existing telemetry implementations and add tests + vitest testing.

brunozoric and others added 4 commits June 3, 2026 12:13
Retries transient HTTP errors (408, 429, 500, 502, 503, 504) and
network failures with configurable attempts and base delay. Respects
Retry-After header on 429 responses.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace node:test + node:assert with vitest 4.1.7
- Add @vitest/coverage-v8 for coverage reporting
- Add happy-dom + @testing-library/react for React component tests
- Add tests for retry logic, debug mode, alias opt-out, trackPageView,
  localStorage fallback, send failures, malformed config, and all React
  hooks (TelemetryProvider, useTelemetry, useTrackPageView)
- Coverage: 56% → 76% statements, 63% → 88% functions
- Add coverage/ to .gitignore

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…e flags

Tests sendBeacon dispatch path, sendBeacon fallback to fetch,
deriveApexDomain edge cases (localhost, IP, single-part, multi-part),
and cookie Secure flag behavior on https vs http.

Coverage: 76% → 80% statements, 70% → 77% branches, 88% → 90% functions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@brunozoric brunozoric self-assigned this Jun 3, 2026
brunozoric and others added 2 commits June 3, 2026 12:47
Extract shared retry helpers (RETRYABLE_STATUS_CODES, sleep,
getRetryDelay) to core.ts and reuse in both NodeTransport and
BrowserTransport. Add retries/retryDelay config to WebClientConfig.
Network errors now re-throw after exhausting retries so dispatch
can log them.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@SvenAlHamad SvenAlHamad merged commit 78ca24e into v3 Jun 3, 2026
5 checks passed
@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

🎉 This PR is included in version 3.1.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants