function buildLcov
buildLcov(rows: FileRow[]): string

Builds a standard LCOV lcov.info string (line coverage only: DA/LF/LH per file).

import * as Report from './report.ts';

const coverage = new Map([
  ['/repo/lib/math.ts', { coverable: new Set([1, 2]), covered: new Map([[1, 3]]), sourceContent: null }],
]);
Report.buildLcov(Report.buildRows(coverage, new Set<string>(), '/repo'));
// 'TN:\nSF:lib/math.ts\nDA:1,3\nDA:2,0\nLF:2\nLH:1\nend_of_record\n'

Parameters

rows: FileRow[]

Return Type

string

Usage

import { buildLcov } from "lib/coverage/report.ts";