Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Allow setting a custom coverage reporter #14331

Closed
benjaminjkraft opened this issue Jul 14, 2023 · 3 comments
Closed

[Feature]: Allow setting a custom coverage reporter #14331

benjaminjkraft opened this issue Jul 14, 2023 · 3 comments

Comments

@benjaminjkraft
Copy link
Contributor

🚀 Feature Proposal

The config option collectCoverage enables a bunch of things throughout Jest. One of these is adding the built-in CoverageReporter to the list of reporters. It would be nice if there were a way to override this, and instead add a custom reporter(s) that makes use of the same data but reports it in other ways.

Motivation

My specific motivation is to experiment with a reporter that merges coverage periodically throughout the test run, rather than only at the end, to work around #14287. In principle, everything I need to change is accessible from the existing reporter extension point. But there's no way to enable coverage collection without the default coverage reporter.

In general, this seems like it could be useful for reporting the coverage in a different format -- for example perhaps we want to use some coverage technique not supported by Istanbul.

Example

(see specific motivation)

Pitch

This seems like a way to allow improvements outside of jest with minimal new API surface. The coverage reporter is already complicated enough; right now something like #14287 can only be solved in jest itself. The API surface all already exists; one could already use the same APIs to add an additional coverage reporter. So this seems net-valuable.

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 30 days.

@github-actions github-actions bot added the Stale label Aug 14, 2023
@github-actions
Copy link

This issue was closed because it has been stalled for 30 days with no activity. Please open a new issue if the issue is still relevant, linking to this one.

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Sep 13, 2023
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 14, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant