IF Commons GitHub

coverage

Written to: 1 requirement: 1 proved, 0 partly, 0 failing, 0 with no test recorded. 0001-docs FR-022

The line coverage of a library's tests (docs 0001-docs FR-022): parseLcov reads the LCOV file that bun test --coverage writes into the files of one library, parseCoverage reads what tools/evidence.ts --coverage keeps of it, and percent is the share of lines hit. Source files only: tests, and what is under node_modules, are left out.

Source: commons/docs/src/coverage.ts

3 of 5 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

FileCoverageinterfaceno test imports it
interface FileCoverage

The lines of one file that the tests reach.

MemberTypeWhat it is
pathstringFrom the root of the repository.
foundnumber
hitnumber
LibraryCoverageinterfaceno test imports it
interface LibraryCoverage

The coverage of one library.

MemberTypeWhat it is
librarystring
filesreadonly FileCoverage[]
parseCoveragefunction
function parseCoverage(text: string): { readonly value: LibraryCoverage; } | { readonly error: string; }

What tools/evidence.ts --coverage kept, or why it cannot be read.

Imported by 21 tests of the run (21 passed, 0 failed): the library's results

parseLcovfunction
function parseLcov(lcov: string, base: string): readonly FileCoverage[]

The files of an LCOV text: each SF: begins a file and LF: and LH: give its lines found and hit; base is what the SF: paths are relative to, from the root of the repository.

Imported by 21 tests of the run (21 passed, 0 failed): the library's results

percentfunction
function percent(files: readonly { readonly found: number; readonly hit: number; }[]): number | undefined

The share of lines hit, 0 to 100, or undefined where there are no lines.

Imported by 21 tests of the run (21 passed, 0 failed): the library's results

Titles, headings, exports, tables, columns and requirements. Esc closes.