Skip to content

Coverage plugin doesn't allow using Jest presets for reporters #727

Description

@matejchalk

A validation check is in place which expects there to be a coverageReporters array including 'lcov' in the jest config export. However, this doesn't take into account setups which set reporters in a shared file extending with preset: '../../jest.preset.js' (common practice in Nx), to reduce duplication. Since the preset file values aren't directly exported by a given project's config in this case, validation fails with Jest coverage configuration at ... does not include LCOV report format for target .... Add 'lcov' format under coverageReporters..

1298c1311
<   if (!testConfig.coverageReporters?.includes("lcov")) {
---
>   if (!testConfig.coverageReporters?.includes("lcov") && !("preset" in testConfig)) {

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions