Skip to content

Configuration options ​

OptionTypeDefaultDescription
logging"off" | "error" | "info" | "debug""info"Logging level. Use "debug" to keep raw cache and dump sourcemaps for troubleshooting. See Debug for Coverage and Sourcemap.
namestring"Coverage Report"Report title shown in the UI and summary reports.
reportsstring | (string | ReportDescription)[]"" (auto)Reports to generate. Defaults to "v8" for V8 data and "html" for Istanbul data. See Available Reports.
outputDirstring"./coverage-reports"Output directory for all reports and the .cache folder.
inputDirstring | string[]nullInput directories of raw coverage data for merging.
baseDirstringprocess.cwd()Base dir used to normalize relative source paths. Set when the report is generated from a different working directory than the sources.
dataDirstringnullCoverage data directory loaded automatically in generate() — alternative to addFromDir().
entryFilterstring | object | functionnull(V8 only) Filter V8 entries by url. See Filtering Results.
sourceFilterstring | object | functionnull(V8 only) Filter sources unpacked from sourcemaps.
outputFilterstring | object | functionnull(V8 only) Filter final files by sourcePath after sourcemap conversion. See Filtering Results.
filterstring | object | functionnullCombined filter replacing both entryFilter and sourceFilter.
sourcePathobject | functionnullRewrite source paths; see Resolve sourcePath.
allstring | string[] | objectnullInclude untested files as empty coverage. See Adding Empty Coverage.
outputFilestring"index.html"(V8 only) Output [sub dir/]filename for the V8 report.
inlinebooleanfalse(V8 only) Inline all assets into a single HTML file.
assetsPathstring"./assets"(V8 only) Assets directory when inline is false.
lcovbooleanfalseAlso generate lcov.info (equivalent to adding the lcovonly report).
v8Ignorebooleantrue(V8 only) Enable/disable comment-based ignoring (v8 ignore …). See Ignoring Uncovered Codes.
reportPathstring | () => stringnullOverride the report entry path (defaults to outputDir/index.html). Useful when multiple reports share an outputDir.
watermarks[number, number] | object[50, 80]Low/high thresholds (percent). Accepts per-metric object like { bytes:[50,80], lines:[50,80] }.
cleanbooleantrueClean previous reports in outputDir before generating (the .cache dir is preserved unless cleanCache is also true).
cleanCachebooleanfalseClean the cache dir on start. When both clean and cleanCache are false, cached coverage data from previous runs is preserved and can be reused across processes.
gcnumbernullMemory threshold in MB; force GC at critical stages when JavaScript heap usage (heapUsed) exceeds it. Useful for very large data sets, see JavaScript heap out of memory.
sourceMapbooleanfalseSave source/sourcemap files to cache for debugging (requires logging: "debug").
sourceMapResolver(url, defaultResolver) => Promise<string | object>nullCustom sourcemap loader (e.g. from a build cache). Call defaultResolver(url) to fall back.
onEntry(entry) => void | Promise<void>null(V8 only) Per-entry hook; see Hooks.
onEnd(coverageResults) => void | Promise<void>nullHook invoked after report generation; see Hooks.