JavaScript coverage tool for mix test --cover.
Reports line-level coverage for all JS/TS code executed through QuickBEAM runtimes during the test suite, alongside standard Elixir coverage.
Setup
# mix.exs
def project do
[
...,
test_coverage: [tool: QuickBEAM.Cover]
]
endThen run:
$ mix test --cover
Elixir coverage works as normal (delegates to Erlang's :cover).
JS coverage is collected automatically from all QuickBEAM runtimes
that start during the test run.
Options
Accepts all standard :test_coverage options, plus:
:js— keyword list of JS-specific options::ignore— file patterns to exclude (default:["node_modules/**"])
Using with excoveralls
If you already use excoveralls, add JS coverage as a sidecar:
# test/test_helper.exs
QuickBEAM.Cover.start()
ExUnit.after_suite(fn _ -> QuickBEAM.Cover.stop() end)JS coverage is written to cover/js_lcov.info.
Summary
Functions
Record JS coverage data collected from a runtime.
Mix test coverage callback. Called by ExUnit when test_coverage: [tool: QuickBEAM.Cover] is set.