@tao.js/router
v0.17.0
Published
connects url routing with tao.js
Readme
Mutation testing (@tao.js/router)
Run
pnpm test:mutation:routerReports in reports/mutation/ (gitignored). Use // Stryker disable … : reason for equivalents.
Notes
- Config:
stryker.config.json—inPlace: true; barrelindex.jsexcluded. jest.config.jssetstestEnvironment: 'jsdom'explicitly — Stryker'sperTestcoverage analysis does not merge the preset-providedtestEnvironment.- Disable equivalent mutants with
// Stryker disable … : reason(colon required). - Equivalents disabled as unobservable, given this package's actual call sites:
capitalize's!str || typeof str !== 'string'guard (Router.js) —stris alwaysundefinedor a string captured from a URL path segment, never a truthy non-string, so!stralone (or forcing the guard true/false) can't diverge from the full guard.reactToRoute'sdebug = falsedefault parameter (Router.js) — every internal caller always passes an explicit boolean, so the default is never evaluated.- Detach's
node.defaultData && node.defaultData.has(...)guard (Router.js) — Attach always initializesdefaultDatatogether withattached, so by the time Detach's outerattached.lengthguard is true,defaultDatais always truthy too. - The
if (incoming.length)guard (Router.js) —[].forEach(...)is already a no-op, so forcing entry into the block changes nothing observable whenincomingis empty. routeHandler.js'sneedData == nullguard —path-to-regexp's compiled path function throws the identicalExpected "..." to be a stringerror whether a param is omitted,null, orundefined.routeTag.js's{ default: '' }lookup option — the finalroute.join('')already converts a missing/undefinedvalue to'', identical to the explicit default.
- Optional
debug && console.log(...)logging paths are Stryker-disabled as equivalent (side-effect-only, not part of the observable contract), matching the convention used across this monorepo's other packages. - Latest score (2026-07-18): 100% (271 killed, 0 timeout, 0 survived; thresholds high=95, low=90).
