Title: Report 0% coverage for untested files in a project (i.e., files matching some glob) · Issue #58887 · nodejs/node · GitHub
Open Graph Title: Report 0% coverage for untested files in a project (i.e., files matching some glob) · Issue #58887 · nodejs/node
X Title: Report 0% coverage for untested files in a project (i.e., files matching some glob) · Issue #58887 · nodejs/node
Description: What is the problem this feature will solve? Right now, the test runner with --experimental-code-coverage doesn't seem to include an entry in the report for files that were not tested at all — i.e., that didn't get loaded during the test...
Open Graph Description: What is the problem this feature will solve? Right now, the test runner with --experimental-code-coverage doesn't seem to include an entry in the report for files that were not tested at all — i.e....
X Description: What is the problem this feature will solve? Right now, the test runner with --experimental-code-coverage doesn't seem to include an entry in the report for files that were not tested at all — ...
Opengraph URL: https://github.com/nodejs/node/issues/58887
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Report 0% coverage for untested files in a project (i.e., files matching some glob)","articleBody":"### What is the problem this feature will solve?\n\nRight now, the test runner with `--experimental-code-coverage` doesn't seem to include an entry in the report for files that were not tested at all — i.e., that didn't get loaded during the test execution — even if those files were matched by a `--test-coverage-include` glob.\n\nThis can make the report very misleading, as the reported \"all files\" coverage percentage can easily go up, even when actual coverage has gone down (i.e.,. because a new file was introduced with no tests at all).\n\nI know this has been raised at least [twice](https://github.com/nodejs/help/issues/4487) [before](https://github.com/orgs/nodejs/discussions/4564), but there didn't seem to be any issue for it on the issue tracker, so I wanted to raise it here.\n\n### What is the feature you are proposing to solve the problem?\n\nThere should be some way to have these untested files show up in the report, but report 0% coverage. The effect (although not necessarily the implementation) would be similar to istanbul's [`--all` option](https://github.com/istanbuljs/nyc?tab=readme-ov-file#selecting-files-for-coverage).\n\nI'm not wedded to a particular API, but one reasonable option might be to have a `--test-coverage-include-all` flag that makes sure that any file matched by `--test-coverage-include` shows up in the report.\n\n### What alternatives have you considered?\n\nAs mentioned [here](https://github.com/nodejs/help/issues/4487), it's possible to sort of simulate this effect by passing a glob to `node --test` that covers all the files in the project. However, every file then gets run as a test file, which is a lot of extra overhead, as these files don't actually have any tests.","author":{"url":"https://github.com/ethanresnick","@type":"Person","name":"ethanresnick"},"datePublished":"2025-06-29T18:21:47Z","url":"https://github.com/nodejs/node/issues/58887"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:39e69d67-3cec-9d0f-de12-a667b602a73b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BF78:3B1A19:8F3231:BE35B1:6AED2CA2 |
| html-safe-nonce | df57eaf927f6dbb07c2f48d83af0f10c73ce0f494bdef04ebcac3e01390cf2a8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCRjc4OjNCMUExOTo4RjMyMzE6QkUzNUIxOjZBRUQyQ0EyIiwidmlzaXRvcl9pZCI6IjUyMTY3MTY4NDkyMzgzMzk0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 121726a84f8e26296286cc05155df55fc1a7984863139e85c5752865a3bc4aac |
| hovercard-subject-tag | issue:3186435144 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/58887/issue_layout |
| twitter:image | https://opengraph.githubassets.com/98908343f9726819c3ae2430249b598aaf6f59a2d92028881ce40961ec0d4d7e/nodejs/node/issues/58887 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/98908343f9726819c3ae2430249b598aaf6f59a2d92028881ce40961ec0d4d7e/nodejs/node/issues/58887 |
| og:image:alt | What is the problem this feature will solve? Right now, the test runner with --experimental-code-coverage doesn't seem to include an entry in the report for files that were not tested at all — i.e.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ethanresnick |
| hostname | github.com |
| expected-hostname | github.com |
| None | e51d0b7b5ab34b1688c05b54c3ed17b8658b2fa9bca973a9c740683ccb12cf4a |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 59ebb7b901cc154ecc179a44f266fcf69f343b30 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width