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

add coverage-path and coverage-ignore-path in test_runner coverage. #51222

Closed
pulkit-30 opened this issue Dec 19, 2023 · 4 comments · Fixed by #53553
Closed

add coverage-path and coverage-ignore-path in test_runner coverage. #51222

pulkit-30 opened this issue Dec 19, 2023 · 4 comments · Fixed by #53553
Labels
feature request Issues that request new features to be added to Node.js. test_runner Issues and PRs related to the test runner subsystem.

Comments

@pulkit-30
Copy link
Contributor

What is the problem this feature will solve?

coverage-path: to specify the path from which the coverage summary should be collected. and
coverage-ignore-path: to specify the files and directories that should be ignored while collecting coverage.

these can be two cli flags also, passed along with --test-coverage flag.
something like this:

node --test --experimental-test-coverage --coverage-path='./src/**' --coverage-ignore='./src/utils/**' index.test.mjs

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

currently, there is no way to include or exclude a file or directory from test coverage.

What alternatives have you considered?

No response

@pulkit-30 pulkit-30 added the feature request Issues that request new features to be added to Node.js. label Dec 19, 2023
@juanarbol
Copy link
Member

That's needs to be supported in V8

https://bugs.chromium.org/p/v8/issues/detail?id=12702&q=&start=300; I've proposed two patches for it, still work in progress

@juanarbol juanarbol added the v8 engine Issues and PRs related to the V8 dependency. label Dec 19, 2023
@sebiniemann
Copy link

I'm uncertain whether this was intended in the original post and if it would be addressed by the chromium ticket.

To evaluate the coverage at the project level, it might be beneficial if the --coverage-path is interpreted such that files without any coverage (files that were unseen by v8) are included in the report with 0% coverage. Minus the files specified via --coverage-ignore.

Copy link
Contributor

There has been no activity on this feature request for 5 months. To help maintain relevant open issues, please add the never-stale Mark issue so that it is never considered stale label or close this issue if it should be closed. If not, the issue will be automatically closed 6 months after the last non-automated comment.
For more information on how the project manages feature requests, please consult the feature request management document.

@github-actions github-actions bot added the stale label Jun 26, 2024
@RedYetiDev RedYetiDev added test_runner Issues and PRs related to the test runner subsystem. and removed v8 engine Issues and PRs related to the V8 dependency. stale labels Jun 26, 2024
@RedYetiDev
Copy link
Member

RedYetiDev commented Jun 26, 2024

FWIW this is implemented with globs in #53553

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Issues that request new features to be added to Node.js. test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants