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.

Hello cordier,

Would you have a code snippet or project template to share so we could reproduce your issue and investigate it?
Imports that are exclusively used for typing are not highlighted in Sonarqube, but they might not be in the coverage HTML either. Could that be the case in your issue?



Can you contact me, so we can discuss how to share our code?


Hello cordier,

Could you paste here a piece of the file that contains the incomplete coverage?


Hello Ilia,

I can’t provide a piece of the file because it’s corporate code.

I would like to investigate and share code with you in private.

Is it possible ?