-
-
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
Allow export of UI including coverage #4760
Comments
Thank you @hi-ogawa, that's exactly what we need. Do you have a feeling until when we can see it being released? |
@hi-ogawa @sheremet-va unfortunately, it still doesn't work with // eslint-disable-next-line spaced-comment
/// <reference types="vitest" />
import swc from 'unplugin-swc';
import tsconfigPaths from 'vite-tsconfig-paths';
import { defineConfig } from 'vitest/config';
export default defineConfig({
plugins: [tsconfigPaths(), swc.vite()],
test: {
globals: true,
environment: 'node',
coverage: {
enabled: true,
provider: 'v8',
reporter: ['text', 'lcov', 'clover', 'html', 'json'],
reportsDirectory: 'html/coverage',
all: true
},
reporters: ['default', 'html']
},
resolve: {
alias: {
'@': 'src'
}
}
}); This is the command I run: "test:cov": "vitest run --coverage" This correctly creates an $ cd html
$ npx http-server -g I was expecting to see the coverage button in the menu in the top left, but it doesn't appear. |
Hmm... not sure what went wrong. I just tested quickly on stackblitz and it seems working fine (except stackblitz initially opens https://stackblitz.com/edit/vitest-dev-vitest-g8ia47?file=vite.config.ts Just in case, could you check Also asset hash in $ ls -lh html/assets
total 590.0K
-rw-r--r-- 1 staff staff 534.3K 12 20 07:55 index-O8DR2YZv.js
-rw-r--r-- 1 staff staff 54.7K 12 20 07:55 index-z19Uws5U.css |
Updating |
Clear and concise description of the problem
Running
vitest --ui --coverage
on my machine correctly opens the Vitest UI including the visual coverage. Runningvitest run --coverage
runs the tests once and creates the directories/html
and/coverage
. I want to put the results on a web server that serves static files. I copied the content of the/html
folder on the webserver and it works well. However, unlike locally, it does not show the coverage, which makes sense since I didn't do anything with the/coverage
folder. Running Vitest UI in watch mode on the server is not possible.Suggested solution
I would like to see an export function that creates static files of the Vitest UI including the coverage that I can serve with a simple web server.
Alternative
No response
Additional context
Config:
Validations
The text was updated successfully, but these errors were encountered: