vue-jest icon indicating copy to clipboard operation
vue-jest copied to clipboard

Coverage showing Unknown%

Open derHodrig opened this issue 2 years ago • 0 comments

First of all, I'm new to this testing aspect but I really want to learn it. I, unfortunately, faced an Issue with the coverage. It does simply not work. The test and code around should be okay. Just to mention, it's a nuxt + typescript setup. But typescript is not actively, because I try to learn this in that repo too. I tried the app, should work fine, tests are running successful, linter also works fine. So I can assure you, it's not the code itself.

Repo

https://gitlab.com/skoenfeld/nuxt-monorepo/-/tree/coverage

used version

"jest": "^27.4.4",
"ts-jest": "^27.1.1",
"vue-jest": "^3.0.4"

pls, use the coverage branch.


install the dependencies and hit jest --coverage

Output should be

 PASS  test/JestTest.spec.js                                                                                                                                                                                                                                                                                            
  JestTest
    √ correct initial values (2 ms)                                                                                                                                                                                                                                                                                     
    √ correct mounted (36 ms)                                                                                                                                                                                                                                                                                           
    √ testing setWord (9 ms)                                                                                                                                                                                                                                                                                            
    √ testing button (9 ms)                                                                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                                                                                                        

=============================== Coverage summary ===============================                                                                                                                                                                                                                                        
Statements   : Unknown% ( 0/0 )
Branches     : Unknown% ( 0/0 )
Functions    : Unknown% ( 0/0 )
Lines        : Unknown% ( 0/0 )
================================================================================
Test Suites: 1 passed, 1 total
Tests:       4 passed, 4 total
Snapshots:   0 total
Time:        6.172 s
Ran all test suites.

Problem

I am getting into testing with vue / nuxt. After writing the first test I tried to show the coverage. The coverage is Unknown for all categories. The HTML in ./coverage/Icov-report shows also an empty table.

Tries

I tried already to lower the jest and vue-jest to v26 as I saw this on other issues. Not working at all. The configuration seems also fine in my opinion. So this might be a bug?

derHodrig avatar Jul 30 '22 00:07 derHodrig