Skip to Content
How it is testedWhat coverage measures

What coverage measures

Vitest’s v8 coverage provider counts the code a test run executed, from what Node’s V8 engine records. It counts nothing about assertions, so a suite that imports every module and asserts nothing still scores high.

Measured at 86c6966e (2026-11-06) on Node v24.20.0, by the build that produced this page.

Four coverage metrics per library

Every @evanion/* library’s vite.config.ts turns coverage on for each test run, and @evanion/acl’s block reads:

coverage: { enabled: true, reporter: ['json-summary'], reportsDirectory: './test-output/vitest/coverage', provider: 'v8' as const, },

The json-summary reporter writes four percentages to coverage-summary.json in the reportsDirectory above. The table gives each library all four, with the count covered over the count the report found:

  • Statements: the statements the run executed.
  • Branches: the paths through each if, else, ternary, switch case and short-circuit operator that the run took.
  • Functions: the functions the run called at least once.
  • Lines: the lines of code the run executed.

Read statements beside branches: a statement percentage well above the branch percentage means lines ran while one path through their conditions never did.

PackageStatementsBranchesFunctionsLinesFiles in the report
@evanion/compose100.00% 18/18100.00% 21/21100.00% 5/5100.00% 17/175
@evanion/luhn100.00% 86/86100.00% 36/36100.00% 14/14100.00% 82/825
@evanion/nestjs-correlation-id100.00% 42/42100.00% 21/21100.00% 14/14100.00% 41/416
@evanion/react-feature98.00% 49/50100.00% 14/1495.00% 19/2098.00% 49/504
@evanion/token100.00% 95/95100.00% 43/43100.00% 18/18100.00% 90/905
@evanion/urn98.88% 177/17997.45% 115/118100.00% 38/3899.38% 162/1636
@evanion/react-widget100.00% 47/4797.05% 33/34100.00% 13/13100.00% 45/458
@evanion/feature98.54% 1,492/1,51496.58% 1,018/1,054100.00% 244/24499.39% 1,324/1,33227
@evanion/acl98.34% 1,964/1,99795.41% 1,289/1,35198.96% 384/38898.86% 1,742/1,76230
@evanion/react-acl96.20% 76/7995.00% 19/2094.73% 36/3897.26% 71/7310
@evanion/widget96.29% 52/5490.19% 46/5184.61% 11/1396.07% 49/518
@evanion/ui96.42% 54/5689.04% 65/73100.00% 29/29100.00% 51/5118
@evanion/astro-widget95.12% 39/4180.00% 16/2066.66% 2/397.50% 39/4018

The table leaves out a workspace average and every file a run did not load:

  • An average would mislead. Several libraries sit at 100% on all four metrics, and @evanion/acl, which holds more test cases than any other library, sits lower. An average of their percentages gives a library of a few dozen statements the same weight as @evanion/acl.
  • The report omits a file no test imported, and the Files in the report column counts the files the run loaded. So 98% there means 98% of what the run loaded, and the library as a whole can sit lower.

Where the branches are not taken

The list below names each @evanion/* library with a file under 100% of its branches, then each such file, and the command that reproduces the figure.

@evanion/acl — 6 files under 100% of branches
  • errors.ts: 50.00% of 4 branches
  • diff-matrix.ts: 82.78% of 122 branches
  • reads-object.ts: 83.33% of 6 branches
  • canonical.ts: 91.66% of 12 branches
  • conditions.ts: 93.05% of 72 branches
  • issues.ts: 94.11% of 17 branches

Reproduce with npx nx test @evanion/acl --coverage.

@evanion/astro-widget — 2 files under 100% of branches
  • /home/runner/work/libraries/libraries/libs/astro-widget/examples/scripts/check-content.ts: 50.00% of 2 branches
  • components/Widgets.astro: 80.00% of 15 branches

Reproduce with npx nx test @evanion/astro-widget --coverage.

@evanion/feature — 6 files under 100% of branches
  • lib/unreadable.ts: 50.00% of 2 branches
  • lib/zones.ts: 75.00% of 4 branches
  • lib/graph.ts: 79.41% of 34 branches
  • lib/features.ts: 95.33% of 150 branches
  • lib/serialize.ts: 95.55% of 45 branches
  • lib/validate.ts: 95.75% of 283 branches

Reproduce with npx nx test @evanion/feature --coverage.

@evanion/react-acl — 1 files under 100% of branches
  • /home/runner/work/libraries/libraries/libs/react-acl/examples/server.tsx: 75.00% of 4 branches

Reproduce with npx nx test @evanion/react-acl --coverage.

@evanion/react-widget — 1 files under 100% of branches
  • /home/runner/work/libraries/libraries/libs/react-widget/examples/listing.tsx: 50.00% of 2 branches

Reproduce with npx nx test @evanion/react-widget --coverage.

@evanion/ui — 4 files under 100% of branches
  • components/Select.tsx: 50.00% of 2 branches
  • client.ts: 73.68% of 19 branches
  • components/Layout.tsx: 88.88% of 9 branches
  • components/CodeBlock.tsx: 90.00% of 10 branches

Reproduce with npx nx test @evanion/ui --coverage.

@evanion/urn — 1 files under 100% of branches
  • lib/urn.ts: 97.32% of 112 branches

Reproduce with npx nx test @evanion/urn --coverage.

@evanion/widget — 2 files under 100% of branches
  • constants.ts: 0.00% of 4 branches
  • validate-items.ts: 97.67% of 43 branches

Reproduce with npx nx test @evanion/widget --coverage.

A branch percentage says a path ran, and a case on the security register says what the path decided. SEC-004, a deny rule reading a field the row lacks, and SEC-018, a clock that does not parse, each tie one @evanion/acl branch to the refusal it produces.

What is not built from these numbers

This site leaves four uses of the @evanion/* coverage figures out:

  • No coverage badge appears on this site or in any README. A badge shows the percentage with no qualifier and no case beside it. @evanion/acl’s percentage covers about a thousand executable lines of pure functions over frozen JSON, with no network code and no code that parses bytes off the wire. Beside a badge from a project that has both, the higher acl number would suggest the stronger suite.
  • No trend line is drawn, because a stored series needs either a committed file that goes stale or a database this static site cannot read.
  • No coverage threshold fails a build. Once a build fails under a minimum, the next test someone writes executes a line to clear it and asserts nothing. The build gates the register: tools/repo-checks/src/security-register.test.ts fails when a register entry and its test come apart.
  • No package page carries a percentage. A reader on /luhn, the page of the check-digit library @evanion/luhn, who sees 100% has learned that every statement of a small library ran, and nothing about what its tests assert.
Last updated on