Skip to content

Lupa API Reference / @pawel-up/lupa/runner / CoverageOptions

Interface: CoverageOptions

Defined in: src/runner/types.ts:373

Options for configuring code coverage instrumentation

Properties

enabled?

optional enabled?: boolean

Defined in: src/runner/types.ts:378

Whether to enable code coverage collection. Defaults to false.


exclude?

optional exclude?: string[]

Defined in: src/runner/types.ts:390

Array of glob patterns to exclude from coverage reports. Files matching these patterns will be skipped during coverage mapping.


extension?

optional extension?: string[]

Defined in: src/runner/types.ts:396

Array of file extensions to process (e.g., ['.js', '.ts', '.jsx', '.tsx', '.vue']). Only files with these extensions will be included in the coverage report.


include?

optional include?: string[]

Defined in: src/runner/types.ts:384

Array of glob patterns to include in coverage reports. Files matching these patterns will be included in the coverage mapping.


reporters?

optional reporters?: string[]

Defined in: src/runner/types.ts:402

List of coverage reporters to run simultaneously (e.g., ['text', 'html', 'lcov']). Defaults to ['text', 'html'] if not specified.


reportsDirectory?

optional reportsDirectory?: string

Defined in: src/runner/types.ts:408

The output directory where the coverage reports will be written. Defaults to './coverage'.


thresholds?

optional thresholds?: object

Defined in: src/runner/types.ts:414

Coverage threshold gates. If the coverage percentages fall below these thresholds, the test run will fail with an exit code of 1.

branches?

optional branches?: number

functions?

optional functions?: number

lines?

optional lines?: number

statements?

optional statements?: number