# `QuickBEAM.Cover`
[🔗](https://github.com/elixir-volt/quickbeam/blob/v0.10.6/lib/quickbeam/cover.ex#L1)

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]
      ]
    end

Then 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`.

# `enabled?`

```elixir
@spec enabled?() :: boolean()
```

# `export_istanbul`

```elixir
@spec export_istanbul(Path.t(), map()) :: :ok
```

# `export_lcov`

```elixir
@spec export_lcov(Path.t(), map()) :: :ok
```

# `record`

```elixir
@spec record(map()) :: :ok
```

Record JS coverage data collected from a runtime.

# `results`

```elixir
@spec results(keyword()) :: map()
```

# `start`

```elixir
@spec start() :: :ok
```

# `start`

Mix test coverage callback. Called by ExUnit when `test_coverage: [tool: QuickBEAM.Cover]` is set.

# `stop`

```elixir
@spec stop(keyword()) :: map()
```

---

*Consult [api-reference.md](api-reference.md) for complete listing*
