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

Experimental coverage skips .ts files #49398

Closed
nicoabie opened this issue Aug 29, 2023 · 3 comments · Fixed by #49406
Closed

Experimental coverage skips .ts files #49398

nicoabie opened this issue Aug 29, 2023 · 3 comments · Fixed by #49406
Labels
test_runner Issues and PRs related to the test runner subsystem.

Comments

@nicoabie
Copy link

Version

v18.17.1

Platform

Darwin mars.local 23.0.0 Darwin Kernel Version 23.0.0: Fri Aug 18 00:02:20 PDT 2023; root:xnu-10002.1.11~5/RELEASE_ARM64_T8103 arm64

Subsystem

No response

What steps will reproduce the bug?

Pointing to ts files

NODE_V8_COVERAGE=./coverage node -r ts-node/register --test --experimental-test-coverage src/**/*.spec.ts

No coverage is reported

How often does it reproduce? Is there a required condition?

Always

Pointing to js files creates a coverage folder

NODE_V8_COVERAGE=./coverage node -r ts-node/register --test --experimental-test-coverage src/**/*.spec.js

What is the expected behavior? Why is that the expected behavior?

To have coverage

What do you see instead?

Seems coverage reporter is filtering out files that don't have extension

  • js
  • cjs
  • mjs

Additional information

No response

@bnoordhuis
Copy link
Member

Why would you expect that to work? Node doesn't handle .ts files. You're probably thinking of ts-node but that's a different project.

@nicoabie
Copy link
Author

Because --test works.
If node:test works using ts-node as loader why would the coverage reporting not work?

@MoLow MoLow added the test_runner Issues and PRs related to the test runner subsystem. label Aug 30, 2023
@MoLow
Copy link
Member

MoLow commented Aug 30, 2023

No reason for it not to work. The only issue is the code isn't mapped correctly to the source since there is no source maps but that shouldn't prevent reporting statistics.
Opened a PR

nodejs-github-bot pushed a commit that referenced this issue Sep 4, 2023
PR-URL: #49406
Fixes: #49398
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
ruyadorno pushed a commit that referenced this issue Sep 28, 2023
PR-URL: #49406
Fixes: #49398
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
alexfernandez pushed a commit to alexfernandez/node that referenced this issue Nov 1, 2023
PR-URL: nodejs#49406
Fixes: nodejs#49398
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
targos pushed a commit that referenced this issue Nov 27, 2023
PR-URL: #49406
Fixes: #49398
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
sercher added a commit to sercher/graaljs that referenced this issue Apr 25, 2024
PR-URL: nodejs/node#49406
Fixes: nodejs/node#49398
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
sercher added a commit to sercher/graaljs that referenced this issue Apr 25, 2024
PR-URL: nodejs/node#49406
Fixes: nodejs/node#49398
Reviewed-By: Chemi Atlow <chemi@atlow.co.il>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
test_runner Issues and PRs related to the test runner subsystem.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants