-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 should be refreshed in the UI when tests are re-run #3504
Comments
since coverage is static we'll need to add no cache headers for any resource in the middleware, working on it... |
Thanks for looking into this. Since your changes haven't been released yet, I tried them locally with a PNPM patch, but the coverage report still doesn't refresh for me. Am I missing anything? |
@sdelpuerto-intelygenz maybe we should add some random/timestamp in the iframe coverage url: Something like this in root page: const useCoverageUrl = computed(() => {
// force change coverage url
return coverageVisible.value ? `${coverageUrl.value}?v=${Math.random()}`: `${coverageUrl.value}?v=${Math.random()}`
})
</script> then change also src attr: <Coverage v-else-if="coverageVisible" key="coverage" :src="useCoverageUrl" /> |
if you're on the coverage page, it will not refresh, I'll try to reload coverage page once re-run finish... |
Clear and concise description of the problem
When running vitest with the
--ui
and--coverage
options, there is no convenient way to see changes to the coverage report through the UI.Suggested solution
It would be great if the coverage report was refreshed every time it's updated, just like the test results are, without user intervention.
Alternative
Alternatively, the currently open report could be synced to the URL. That way the user can refresh the window and not have to navigate back to the report they were looking at earlier, but this still requires user intervention.
Additional context
The way it currently works, I'd rather have a new tab open when I click on the coverage button on the UI, rather than show an iframe that doesn't automatically refresh or stay synced with the URL. Being able to have this behavior could also be a potential solution.
Validations
The text was updated successfully, but these errors were encountered: