mirror of
https://github.com/mozilla/pdf.js.git
synced 2026-05-31 23:31:02 +02:00
Instrument JS files on-the-fly via babel-plugin-istanbul when --coverage or --coverage-per-test is passed, producing an aggregate lcov/HTML report at the end of the run. A persistent PDFWorker accumulates worker-thread coverage alongside the main-thread coverage, collected via a new GetWorkerCoverage message handler. With --coverage-per-test, an inverted index (build/coverage/per-test-index.json) is also built as tests run, mapping each hit source line and function name to the numeric IDs of the tests that exercised it, keeping the output compact. The new `gulp test_search --code=file::line_or_function` tool queries the index, and passing --code to browsertest pre-filters the test run to only those tests. Coverage output formats are selectable via --coverage-formats (default: info; also accepts html, json, text, cobertura, clover).