Closed derHodrig closed 2 years ago
Hey @derHodrig,
I was able to reproduce your issue & didn't find a solution for the version of vue-jest you use.
Since v3.0.4 is outdated I removed the vue-jest
dependency & added "@vue/vue2-jest": "^27.0.0"
to your project. After that the coverage was collected correctly.
Note that when replacing the dependency you have to update the vue transformer inside your jest.config.js
to
'.*\\.(vue)$': '@vue/vue2-jest',
Thank you @meufel!
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
pls, use the coverage branch.
install the dependencies and hit
jest --coverage
Output should be
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?