testing/error_coverage.ts view source
(collector: ErrorCoverageCollector, route_specs: RouteSpec[], options?: ErrorCoverageOptions | undefined): void import {assert_error_coverage} from '@fuzdev/fuz_app/testing/error_coverage.js'; Assert error coverage meets a minimum threshold.
Computes the ratio of exercised error paths to total declared error paths,
each declared code at each status of a route's error map
(collector.route_error_maps) one path. An observation with a code covers
that path alone; a status-only observation (a null code) covers every declared code at
its status (the "any-code" rule).
When min_coverage is 0 (default), logs coverage info without failing.
When > 0, fails if coverage is below the threshold.
collector
route_specs
RouteSpec[]options?
returns
void throws
AssertionError- if `min_coverage > 0` and the covered/total ratio falls below the threshold — the failure message lists every uncovered route + status (+ code).