Vitest coverage is not generating coverage summary even with json-summary reporter set. #7438
-
Hi all, Vitest coverage run is not generating coverage summary even with json-summary reporter set. Below is my vitest config. import path from 'path';
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
alias: {
'@': path.resolve(__dirname, './src'),
'@test': path.resolve(__dirname, './test'),
},
reporters: ['default'],
coverage: {
provider: 'v8',
reporter: ['text', 'json-summary', 'json'],
reportOnFailure: true,
},
setupFiles: ['./test/setup/custom_matchers.ts']
},
}); When I check the coverage directory, it only generates the coverage-final.json. I was hoping to see coverage-summary.json somewhere but there is none. $ ls
base.css coverage-final.json prettify.css sorter.js
block-navigation.js favicon.png prettify.js src
clover.xml index.html sort-arrow-sprite.png |
Beta Was this translation helpful? Give feedback.
Answered by
AriPerkkio
Feb 6, 2025
Replies: 1 comment 3 replies
-
Works fine here: https://stackblitz.com/~/edit/vitest-dev-vitest-jsxeft9m?file=vite.config.ts |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make sure you have the coverage options in
vitest.config.ts
, not in thevitest.base-config.ts
that those projects extend.