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

.mts files are excluded from coverage #2485

Closed
6 tasks done
pmosconi opened this issue Dec 11, 2022 · 0 comments · Fixed by #2492
Closed
6 tasks done

.mts files are excluded from coverage #2485

pmosconi opened this issue Dec 11, 2022 · 0 comments · Fixed by #2492
Labels
feat: coverage Issues and PRs related to the coverage feature

Comments

@pmosconi
Copy link

Describe the bug

I have a node typescript module project and source files have extension .mts
Test coverage report doesn't include any source file, I verified this with both C8 and istanbul.
Tests run correctly regardless they have extension .mts or .ts.

Reproduction

Minimal example in https://github.com/pmosconi/vitest-issue

  Coverage enabled with c8

tests/sample.test.mts (1)

Actual:
Test Files 1 passed (1)
Tests 1 passed (1)
Start at 12:51:48
Duration 1.17s (transform 455ms, setup 0ms, collect 64ms, tests 3ms)

% Coverage report from c8
----------|---------|----------|---------|---------|-------------------
File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
----------|---------|----------|---------|---------|-------------------
All files | 0 | 0 | 0 | 0 |
----------|---------|----------|---------|---------|-------------------

Expected: src/index.mts to be in coverage report with coverage 100%

System Info

System:
    OS: Windows 10 10.0.19044
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 16.80 GB / 31.76 GB
  Binaries:
    Node: 18.12.1 - C:\Program Files\nodejs\node.EXE
    npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  npmPackages:
    vite: ^4.0.0 => 4.0.0
    vitest: ^0.25.7 => 0.25.7

Used Package Manager

npm

Validations

@sheremet-va sheremet-va added the feat: coverage Issues and PRs related to the coverage feature label Dec 11, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feat: coverage Issues and PRs related to the coverage feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants