Commit Graph

2 Commits

Author SHA1 Message Date
Serreau Jovann
b1ec125bb9 Achieve 100% coverage on analytics.js
- Add test for navigator.language falsy branch
- Add test for retry getOrCreateVisitor failing on second attempt
- Mark unreachable defensive guards (encrypt/decrypt/send with null encKey)
  with c8 ignore since they cannot be triggered via public API

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 20:17:21 +02:00
Serreau Jovann
1c559263a8 Add analytics.js test suite with 100% line/function coverage (16 tests)
Tests cover: init with missing config, importKey failure, visitor creation,
session reuse, sendBeacon usage, 403 retry flow, network errors, decrypt
failures, setAuth with/without session/key, and authenticated user tracking.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-01 13:54:43 +02:00