Coverage reports not accurate Vue 3 + Typescript


We currently work on a project used Vue 3 + typescript and reports coverage seems to be not accurate.

With the same provided, we have differences between local and ci environments.

In vue 3 components single file with typescript support, import statements are not covered in sonarcloud while it is not the case in local environment.

Sonar Scanner : v4.7.0.2747 (sonarqube-scanner npm package)
CI : Github actions
Langage : Vite + Vue 3 + Typescript
Unit / Acceptance tests : Jest 26.6.3, vue-jest 5.0.0-alpha.10
Component tests : Cypress 10.3.0, nyc 15.1.0

Have you already encountered this issue ? Have you got a solution to fix this issue?

Thanks in advance,


Hey there.

When you speak about your local environment – what are you referring to? A SonarQube instance? Another visualization of your coverage data?


Thank you for your response.

We use nyc to instrument code coverage and run our components tests with cypress, it generates and reporter html.
We use jest to instrument code and run our acceptance tests, it generates and reporter html too.

We both use the same tools in ci and local environement.

Import statements are correctly covered in local when I directly open the html report.
So I tried to use genhtml (a ubuntu package) to reverse and generate html report because I think there is an issue with provided to sonar ; Imports statements are still covered with this operation.

When we provide which be generated in ci environement.

Here you are my :


Import statements are not covered whereas any statements which use these import are covered.


To complete my previous response, we don’t use a sonarqube instance to generate reports in local.
Any suggestions to give me in order to fix this issue ? We can’t put in place an accurate test strategy with this issue.

Any help is appreciated.