Command Palette

Search for a command to run...

oorty coverage

Free

Run 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

OptionDefaultDescription
--cwd <path>.Project root
--top <n>25Maximum number of lowest-covered files in the summary table
--threshold <pct>(none)Only list files whose line coverage is below this percentage
--htmloffInclude Vitest's HTML reporter (one HTML file per source file plus assets). Omit for a light run with only terminal +coverage-summary.json.
--open-htmloffImplies --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-analyzeSkip the Oorty file table; show only Vitest output

What it does

  • Runs vitest run --coverage with text and json-summary reporters by default (terminal table + a single coverage-summary.json).
  • Adds the html reporter only when you pass --html or --open-html, so the default run does not create dozens of HTML files.
  • Writes under your Vitest coverage.reportsDirectory (default coverage/).
  • After a successful run, reads coverage-summary.json and prints overall line/statement/function/branch totals plus a table sorted by lowest line coverage.
  • Line-level detail needs the HTML reporter: use --html or --open-html. With --open-html, Oorty serves that folder over HTTP instead of a file:// URL.

Requirements

  • vitest and @vitest/coverage-v8 in package.json
  • Projects with testRunner: "jest" in oorty.json should use Jest's coverage instead; this command is Vitest-only.

Example

Terminal
npx oorty coverage --top 15
npx oorty coverage --html # full HTML tree only (no server)
npx oorty coverage --open-html # HTML + localhost + browser; Ctrl+C to stop

Related

Generate tests first, then measure coverage.

oorty generate