Skip to content

test: hit 100% coverage and bump to v0.5.3 - #7

Merged
Sajadlance merged 1 commit into
mainfrom
test/coverage-100
May 5, 2026
Merged

test: hit 100% coverage and bump to v0.5.3#7
Sajadlance merged 1 commit into
mainfrom
test/coverage-100

Conversation

@Sajadlance

Copy link
Copy Markdown
Collaborator

Summary

  • Local coverage was 93.12% / 88.5% / 100% / 96.28% (stmts / branches / funcs / lines); now 100% / 100% / 100% / 100%. Codecov was reporting ~89% line coverage on main; this push should bring it to 100%.
  • Adds 10 new tests across `catchAsync` (duplicate-next guard, pre-wrapped own and inherited methods, parent-walk shadow skip for child overrides and non-function data props, Proxy with throwing symbol-marker read) and `handleCommonErrors` (Axios statusText missing / empty / non-string, AggregateError sub-error that throws on every primitive coercion).
  • Drops the dead `?? "Error"` branch in `httpErrors.createErrorFactory` (internal type tightening — public factory shapes unchanged).
  • Stages the plain-text fallback in `errorMiddleware` so an `istanbul-ignore` can target the never-reached empty-statusText branch.
  • Annotates the remaining unreachable defensive guards with `/* istanbul ignore next|if */` and a one-line rationale.

Test count: 188 → 198, all green. Bundle output unchanged (ESM 16.04 KB / CJS 17.18 KB / .d.ts 7.99 KB).

Test plan

  • `npm run build` — clean tsup output
  • `npm test` — 198/198 passing
  • `npm run lint` — clean, --max-warnings=0
  • `npm run type-check` — clean
  • `npm run check-types-pack` — 4/4 attw quadrants 🟢
  • CI matrix on Node 18.x / 20.x / 22.x / 24.x is green
  • Codecov reports 100% line coverage on main after merge

- Add 10 new tests covering: catchAsync duplicate-next guard,
  pre-wrapped own/parent methods on a decorated class, parent-walk
  shadow skip for child overrides, parent-walk skip for non-function
  data properties, Proxy with throwing WRAPPED-symbol read.
- Add AxiosError tests for missing / empty / non-string upstream
  statusText, and an AggregateError sub-error that throws on every
  primitive coercion.
- Drop the dead `?? "Error"` fallback in httpErrors.createErrorFactory
  by making `defaultMessage` required (internal-only signature change;
  public factory shapes unchanged).
- Stage the plain-text fallback statusText in a single const in
  errorMiddleware so the istanbul-ignore can target it cleanly.
- Annotate unreachable defensive guards with `/* istanbul ignore */`
  comments and rationale.

Coverage: 100% statements / 100% branches / 100% functions / 100%
lines. 198 tests, all green.
@Sajadlance
Sajadlance merged commit d399dc2 into main May 5, 2026
7 checks passed
@Sajadlance
Sajadlance deleted the test/coverage-100 branch May 5, 2026 18:16
@codecov

codecov Bot commented May 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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