Vue-jest: Test coverage report not working.

Created on 11 Jul 2019  路  4Comments  路  Source: vuejs/vue-jest

The test coverage report is not working. Terminal details and html report, both are not being generated.

I created a project with vue cli 3.0 to do the tests. Available in github: https://github.com/xereda/vue-3.0

Commands executed:

npm run test:unit -- --coverage  
// vue-cli-service test:unit "--coverage"

DeepinScreenshot_select-area_20190711140344

npm run test:unit -- --coverage --watch
//  vue-cli-service test:unit "--coverage" "--watch"

DeepinScreenshot_select-area_20190711140449

Report not generated:

DeepinScreenshot_select-area_20190711140636

bug

Most helpful comment

Just an update if anyone's following this issue: as explained in another issue (https://github.com/vuejs/vue-jest/issues/217) the problem seems to be related to latest version of jest v25. Downgrading seems to be a decent enough workaround to this problem for the meantime

All 4 comments

Any solution to this? I just tried a new project

npx @vue/cli@3 create cli3-test and then in cli3-test running npm run test:unit -- --coverage I'm getting the same results.

Thx

I'd like to chime in here, I'm facing essentially the same problem, currently with vue-jest 3.0.5 I can't get any coverage report for vue files. all I get are for js files.
On a separate project I have no problems with coverage, but it's using 4.0.0 beta 2.
On this current project I'm unable to upgrade as I'm getting errors in compilation of the templates (I'm using @nuxt/style-resources module to include some scss variable in my templates and for some reason this is not picked up and fails abruptly).
Any suggestion/tip, is greatly appreciated!

Just an update if anyone's following this issue: as explained in another issue (https://github.com/vuejs/vue-jest/issues/217) the problem seems to be related to latest version of jest v25. Downgrading seems to be a decent enough workaround to this problem for the meantime

Downgrading to 24.9.0 fixes the issue, now I have my vue components shown in the test coverage
table

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jacobmischka picture jacobmischka  路  8Comments

aantipov picture aantipov  路  8Comments

mazipan picture mazipan  路  10Comments

nothingismagick picture nothingismagick  路  4Comments

chenxeed picture chenxeed  路  5Comments