js/commands/coverage

js/commands/coverage.ts

fino:commands/coverage — inspect and gate native V8 coverage artifacts.

The command reads the versioned JSON artifact produced by fino test --coverage. Its subcommands deliberately answer one question at a time—aggregate summary, per-file totals, uncovered source lines, functions, branches, or Realm participation—using stable labeled text that is concise enough for both people and language models. check turns the same data into a non-zero gating result, while export lcov provides the conventional interchange format without discarding Realm data from the canonical JSON file.

--input defaults to coverage/coverage.json on the command and every subcommand. Put it after a subcommand when selecting one, for example fino coverage lines src/config.ts --input artifacts/unit.json.

Coverage ranges originate in the Chrome DevTools Protocol and are remapped according to ECMA-426 before this command reads them. This module does not reinterpret generated offsets or source maps.

import coverage from 'fino:commands/coverage';

console.log(await coverage.parse(['files', '--input', 'coverage/coverage.json']));

Constants

const command

The coverage command mounted by the root Fino CLI.

With no subcommand it prints the same aggregate view as summary. The default artifact is coverage/coverage.json; each subcommand also accepts --input <path> after its name.