Skip to content

test(web): close branch-coverage gaps in fetch + errors instrumentation#29

Merged
Isonimus merged 1 commit into
mainfrom
test/instrumentation-branch-coverage
Jun 10, 2026
Merged

test(web): close branch-coverage gaps in fetch + errors instrumentation#29
Isonimus merged 1 commit into
mainfrom
test/instrumentation-branch-coverage

Conversation

@Isonimus

@Isonimus Isonimus commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

Why

The roadmap listed fetch.ts / vitals.ts / errors.ts / behavior.ts as "currently untested," but that note predated their suites — all four are actually covered. What remained were branch-coverage gaps in the two with real conditional logic.

What

  • fetch.ts — branch 61.9% → 90.5%, lines 100%. Added: Headers-instance and array-of-tuples header merging (core to correct traceparent injection), URL-object and Request-object inputs (both in fetch's RequestInfo | URL signature), and the malformed-URL fallback (getPathname + the self-instrumentation guard).
  • errors.ts — branch → 100%. Added: the no-.error-object fallback to 'Error' (resource-load failures fire error with no .error), and an explicit file-path-stripping assertion (the roadmap's "sanitize stack traces" guarantee).

behavior.ts (95%/100%) and vitals.ts were already complete.

Verification

77 tests in packages/web, all green.

The ROADMAP.md check-off for this item is intentionally left out of this PR (it sits next to unrelated uncommitted roadmap edits).

The fetch and errors instrumentations had real suites but residual branch
gaps. Cover them:

- fetch.ts (branch 61.9% -> 90.5%, lines 100%): Headers-instance and
  array-of-tuples header merging, URL- and Request-object inputs, and the
  malformed-URL fallback in getPathname / the self-instrumentation guard.
- errors.ts (branch -> 100%): the no-.error-object fallback to 'Error'
  (resource-load failures) and explicit file-path stripping in sanitize().

77 tests in packages/web.
@Isonimus Isonimus merged commit fdbdc20 into main Jun 10, 2026
3 checks passed
@Isonimus Isonimus deleted the test/instrumentation-branch-coverage branch June 10, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant