The browser parity tests (tests/test_browser.py) verify that runtime.mjs produces the same results as the Python runtime, but we have no code coverage metrics for the JavaScript side. Uncovered JS branches are invisible to codecov (which only sees Python coverage from pytest-cov).
Proposal
Add c8 (V8 built-in coverage) to the browser parity test runs. The parity tests already execute via Node.js 22 through harness.mjs, so wrapping with c8 should be straightforward.
Steps
- Add
c8 as a dev dependency (or use npx c8)
- Run parity tests through
c8 node harness.mjs ... to generate coverage
- Export as lcov and upload to codecov alongside the Python coverage report
- Optionally set a JS-specific coverage threshold
Benefits
- Identifies dead code and untested branches in
runtime.mjs
- Catches regressions when adding new host imports (e.g. Map, Set, future types)
- Unified coverage view in codecov (Python + JS)
The browser parity tests (
tests/test_browser.py) verify thatruntime.mjsproduces the same results as the Python runtime, but we have no code coverage metrics for the JavaScript side. Uncovered JS branches are invisible to codecov (which only sees Python coverage from pytest-cov).Proposal
Add
c8(V8 built-in coverage) to the browser parity test runs. The parity tests already execute via Node.js 22 throughharness.mjs, so wrapping withc8should be straightforward.Steps
c8as a dev dependency (or usenpx c8)c8 node harness.mjs ...to generate coverageBenefits
runtime.mjs