Skip to content

DoubleSharp

doublcov

Coveragenpm

doublcov

doublcov turns LCOV coverage data into a report you can inspect locally or publish as static files. Start with an existing lcov.info file, or let a built-in builder run a supported coverage tool first. Reports connect file totals to source code and provide navigation through uncovered lines, branch and function totals, parser diagnostics, and coverage history. The same report builder works across language ecosystems because LCOV supplies the measurements. Choose a self-contained standalone report for local review or split static assets for larger reports and hosted CI results.

How LCOV becomes a source report

  1. Collect measurements

    Point build at an existing LCOV file, or choose a builder that invokes your installed coverage tool and then finds its LCOV output.

  2. Resolve the source

    Set source roots and extensions to match the paths recorded by the coverage tool. The report combines those files with LCOV line, branch, and function records.

  3. Generate the report

    Write a standalone index.html or static report directory. Optional configuration supplies report defaults, themes, history location, and declarative links.

  4. Inspect missing coverage

    Browse file totals and source lines, jump between uncovered locations, and review diagnostics. Share the generated output as a CI artifact or on a static host.

Build from coverage you already have

The npm CLI requires Node.js 22 or newer. Generate LCOV with your existing test workflow first, then run the command below from the project root. Adjust --lcov and --sources to match that output. --no-open keeps the command suitable for a scripted run without opening a browser.

npm install --save-dev @0xdoublesharp/doublcov
npx @0xdoublesharp/doublcov build --lcov coverage/lcov.info --sources src --out coverage/report --no-open

Let a builder run the coverage tool

For a Vitest project with coverage dependencies installed, use the vite builder. Arguments after -- go to the underlying tool. Other builders cover Foundry, Hardhat, Jest, the Node test runner with c8, pytest, Rust coverage tools, and gcov/lcov. These commands invoke ecosystem tools; they do not replace the tests or tool configuration your project needs.

npx @0xdoublesharp/doublcov vite --no-open -- src/catalog.test.ts

Choose how to open and share the output

Local builds default to standalone mode, which embeds the report in index.html and opens it from disk. CI defaults to static mode, with assets and lazy-loaded JSON. Use doublcov open coverage/report to inspect either format; static mode starts a foreground local server. Configuration in doublcov.config.json can preserve common paths and browser preferences. Explicit CLI flags take precedence over configuration defaults.

Read coverage as evidence about execution

Missing source files often mean LCOV paths and source roots disagree. Unknown extensions can be included as plain text with --extensions. A report can only describe the measurements its coverage producer supplied, so use uncovered navigation to choose the next tests, then inspect their assertions. When sharing a report, account for the source code included in it. Keep generated reports outside committed source and retain history deliberately if comparisons matter.

Keep building

Find more DoubleSharp packages for application development, testing, and operations.

Libraries & Tools