oorty coverage
FreeRun Vitest with V8 coverage, then print overall metrics and a file-by-file table from Vitest's json-summary output by default—no huge HTML tree. Add --html when you want Vitest's full HTML report (many files). With --open-html, Oorty writes HTML for that run, serves it on http://127.0.0.1, and opens your browser (like playwright show-report). Uses @vitest/coverage-v8 (installed by oorty init)—no separate coverage service.
Usage
Terminal
npx oorty coverage [options]Options
| Option | Default | Description |
|---|---|---|
--cwd <path> | . | Project root |
--top <n> | 25 | Maximum number of lowest-covered files in the summary table |
--threshold <pct> | (none) | Only list files whose line coverage is below this percentage |
--html | off | Include Vitest's HTML reporter (one HTML file per source file plus assets). Omit for a light run with only terminal +coverage-summary.json. |
--open-html | off | Implies --html, then after tests pass start a static server on localhost, open your default browser, and wait until Ctrl+C (same idea as playwright show-report). |
--no-analyze | — | Skip the Oorty file table; show only Vitest output |
What it does
- Runs
vitest run --coveragewith text and json-summary reporters by default (terminal table + a singlecoverage-summary.json). - Adds the html reporter only when you pass
--htmlor--open-html, so the default run does not create dozens of HTML files. - Writes under your Vitest
coverage.reportsDirectory(defaultcoverage/). - After a successful run, reads
coverage-summary.jsonand prints overall line/statement/function/branch totals plus a table sorted by lowest line coverage. - Line-level detail needs the HTML reporter: use
--htmlor--open-html. With--open-html, Oorty serves that folder over HTTP instead of afile://URL.
Requirements
vitestand@vitest/coverage-v8inpackage.json- Projects with
testRunner: "jest"inoorty.jsonshould use Jest's coverage instead; this command is Vitest-only.
Example
Terminal
npx oorty coverage --top 15npx oorty coverage --html # full HTML tree only (no server)npx oorty coverage --open-html # HTML + localhost + browser; Ctrl+C to stopRelated
Generate tests first, then measure coverage.