Repository navigation
Exclude test files from coverage report #53508
Description
Activity
- addedfeature requestIssues requesting new Node.js features.Issues requesting new Node.js features.
on Jun 19, 2024 - addedtest_runnerIssues and PRs related to the test runner subsystem.Issues and PRs related to the test runner subsystem.
on Jun 19, 2024 Seems simple enough. The same logic for
--test-skip-patterncan be used.--coverage-exclude-glob ...
--coverage-include-glob ...- addedcoverageIssues and PRs related to Node.js code coverage support.Issues and PRs related to Node.js code coverage support.
on Jun 19, 2024 I'm happy to work on this :-).
Reacted by Moshe Atlow and Roberto BianchiHey! Sorry for the delay, I've been out-of-town, but I'll begin work on this ASAP.
Reacted by Roberto Bianchi8 remaining items
@redyetidev Just created a PR with the "default exclude" behaviour: #55633
@pmarchini IMHO this issue is completed, the PR itself should be the discussion for the other exclusion rules. If you disagree, re-open
@redyetidev, I reopened the issue since there's a related PR that will resolve this. Even though the PR is the right place for the implementation discussion, I think it might be better to keep this issue open until the PR lands.
I've seen many times in the past where PRs get stuck or are no longer under active development, and I found them through the issues.What do you think?
Reacted by Aviv KellerSGTM, thanks for your insight :-)
Reacted by Pietro MarchiniFixed by #56060
cc: @pmarchini
What is the problem this feature will solve?
Hey folks! 👋🏼
I know that as by doc it's currently not possible to exclude specific files or directories from the coverage report.
The problem I face right now is that the coverage includes all of the test files.
For instance, if I have the following file:
and the test:
Once I run
node --experimental-test-coverage --testI get:What is the feature you are proposing to solve the problem?
Ideally,
.test.*should be excluded from the coverage reportWhat alternatives have you considered?
No response