Skip to content

test_runner: lcov reporter for test coverage #49626

Closed
@philnash

Description

@philnash

What is the problem this feature will solve?

We can now produce code coverage reports from the built-in test runner and (currently experimental) code coverage. Being able to report that coverage to third-parties, like SonarQube, SonarCloud, Coveralls, or Code Climate is useful to track coverage over time.

Each of these tools accepts lcov as a format for providing test coverage results.

What is the feature you are proposing to solve the problem?

I propose to write a test reporter that outputs code coverage results in the lcov format.

I've actually got quite a long way through this, as part of adding more information to the test:coverage event sent to reporters. I don't wish the reading of the lcov documentation on anyone else.

I did want to raise a feature request to see if there were any comments or thoughts before I open a PR.

What alternatives have you considered?

This could be built as a third-party module, but given lcov's seeming ubiquity as the code coverage format of choice for different code quality tools, it would be useful for users to have it built in.

In comparison with other platforms, Deno can generate an lcov report from its coverage output and Bun has an open issue to implement lcov, so this is becoming par for the course for a test runner.

I am happy to work on this. Full disclosure, I work at Sonar and this would be beneficial to our users if they decide to choose to use the Node test runner in their projects.

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues that request new features to be added to Node.js.test_runnerIssues and PRs related to the test runner subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions