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

Builds a self-contained HTML report: a summary table plus per-file source with line coloring.

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

const coverage = new Map([
  ['/repo/lib/one.ts', { coverable: new Set([1]), covered: new Map([[1, 1]]), sourceContent: 'export const one = 1;' }],
]);
const html = Report.buildHtml(Report.buildRows(coverage, new Set<string>(), '/repo'));
html.includes('100.00%'); // true — the overall badge; each file's colored source follows

Parameters

rows: FileRow[]

Return Type

string

Usage

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