-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Coverage report not clear and inconsistent with vue #2155
Comments
The coverage report from Jest doesn't contain any Are the uncovered parts in Vitest's reports really covered by tests? I'm not familiar with Vue so I cannot really spot these from tests. If you include these // module/primary/modules-patch ModulesPatch.vue
@keyup.enter="toggleModule(module.slug)"
^^^^^^^^^^^^^^^^^^^^^^^^^ Coverage report from Jest - there are no vue files reported at all
Coverage report from vitest - this one includes vue files
|
Ok, I see. In the jest subset, we have the coverage from the called ".component.ts" files from the ".vue" I saw, in the vitest coverage you have the ".component.ts" files but with a query string suffix (I saw also the suffix files can't be open). The |
Everything else on the coverage report looks good to me. If there is something missing or marked falsely in the reports, I'm happy to help if you can set up a minimal reproduction case. Using whole
This looks like a separate issue that should be fixed. I'll look into it. |
I just copy @pascalgrimaud to help him follow the issue. I'm a little busy this week, so, Pascal, if you want to reproduce it in a minimal case, don't hesitate ;) otherwise, i'll do it when I'm back. |
@AriPerkkio I've just updated the Seems to be a problem on the sonar report I use on Windows but not Linux, here is the stack: https://github.com/jhipster/jhipster-lite/actions/runs/3329636871/jobs/5507108397 So to resume, currently the problem seems to be related to the unexisting path, example from the stack:
If you want to reproduce, it's needed to go to target/test-results/index.html, open it in a browser ang going to a Don't know if you prefer follow it in this issue or another one. |
I can reproduce the issue now and with some quick hacks it seems to be possible to fix this. This required query parameter removal from coverage maps entries, Here the file opens fine and shows coverage nicely: Coverage text report without query params
However this seems to be quite tricky to fix. I'll need to check how Jest is doing this before applying any real fixes to Vitest. |
Describe the bug
On a vue with TypeScript, vitest and istanbul plugin:
Some coverage information are not clear and inconsistent especially in the
.vue
files but it's not the case using jest.In the reproduction case, the coverage is
100%
for each measures using jest but not with vitestActually, the problem is blocking to merge the PR jhipster/jhipster-lite#3231 on JHipster Lite generator, that's why I put a link here.
Sorry by advance if the reproduction case is not so minimal, it's because it's linked to the PR and this may evolve with the time. If really needed, please answer this issue but I think it's interesting to have the history from the JHipster Lite PR.
Reproduction
Prerequisites: latest LTS node version
Reproduction:
npm ci
(orinstall
)npm test
target/test-results
)You may get this in the summary:
The expected coverage can be reproduced using
jest
, it's just the same way to reproduce:npm ci
(orinstall
)npm test
target/test-results
)You may get this in the summary:
Note: if you want the exact behaviour between jest and vitest, you can also switch to the previous commit from my fork because the goal of the fork is to migrate from jest to vitest.
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: