Tests and coverage
Every file exporting code has a spec next to it (format-number.ts → format-number.spec.ts), run by Vitest. The check fails below 100 % coverage of lines, branches, functions and statements.
- Each API page lists the tests of its function, with their result from the last build, and its line coverage.
- The SVG specs render real SVG in Chromium (the
browserproject of Vitest, through Playwright): runpnpm exec playwright install chromiumonce; the CI installs it at each run. - The full coverage report shows every line and branch.
pnpm testruns the specs,pnpm coverageadds the coverage report.pnpm checkruns everything before a push: catalog, types, lint, format, unused code, tests with coverage.