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

Coverage report not including any files #378

Closed
6 tasks done
robcaldecott opened this issue Dec 30, 2021 · 5 comments · Fixed by #584
Closed
6 tasks done

Coverage report not including any files #378

robcaldecott opened this issue Dec 30, 2021 · 5 comments · Fixed by #584

Comments

@robcaldecott
Copy link
Contributor

Describe the bug

I created a simple Vite React TS app that uses testing-library, etc. but running vitest --coverage does not work and no files are included:

$ npm run coverage

> vite-project@0.0.0 coverage
> vitest --run --coverage


 RUN  /Users/rob/vite-project

 √ src/App.test.tsx (1)

Test Files  1 passed (1)
     Tests  1 passed (1)
      Time  4.53s (in thread 151ms, 3007.08%)

----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |       0 |        0 |       0 |       0 |                   
----------|---------|----------|---------|---------|-------------------

Reproduction

https://github.com/robcaldecott/vitest-coverage

System Info

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i5-6360U CPU @ 2.00GHz
    Memory: 373.21 MB / 8.00 GB
    Shell: 3.2.57 - /bin/bash
  Binaries:
    Node: 16.13.1 - /usr/local/bin/node
    Yarn: 1.19.1 - /usr/local/bin/yarn
    npm: 8.1.2 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Browsers:
    Chrome: 96.0.4664.110
    Firefox: 61.0.1
    Safari: 14.1.2
  npmPackages:
    @vitejs/plugin-react: ^1.0.7 => 1.1.3 
    vite: ^2.7.2 => 2.7.10 
    vitest: ^0.0.124 => 0.0.124

Used Package Manager

npm

Validations

@sheremet-va sheremet-va added the bug label Jan 1, 2022
@michealroberts
Copy link

I can confirm this is also happening. In a vanilla-ts project.

@grixu
Copy link

grixu commented Jan 10, 2022

I also confirm this bug, in vue-ts project

@michealroberts
Copy link

@robcaldecott This seems to now be fixed in version > 0.1.

@robcaldecott
Copy link
Contributor Author

Still not working for me for any .tsx files in the src folder.

@Demivan
Copy link
Member

Demivan commented Jan 23, 2022

Fixed in v0.2.0

Tested on https://github.com/robcaldecott/vitest-coverage

 √ src/App.test.tsx (1)

Test Files  1 passed (1)
     Tests  1 passed (1)
      Time  1.74s (in thread 82ms, 2127.31%)

----------|---------|----------|---------|---------|-------------------
File      | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s 
----------|---------|----------|---------|---------|-------------------
All files |     100 |      100 |     100 |     100 |                   
 App.tsx  |     100 |      100 |     100 |     100 |                   
----------|---------|----------|---------|---------|-------------------

Demivan added a commit to Demivan/vitest that referenced this issue Jan 28, 2022
chaii3 pushed a commit to chaii3/vitest that referenced this issue May 13, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Jun 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants