Display coverage from a subdir with Vitest UI #3916
-
Hi Vitest Team! Is it possible to have Vitest UI display code coverage results from a sub-directory? To elaborate, I have the following configuration: const config = defineConfig(({ command }) => ({
test: {
include: ['src/**/?(*.)unit.test.[jt]s?(x)'],
environment: 'happy-dom',
watch: false,
root: rootDir,
reporters: process.env.CI ? 'dot' : undefined,
setupFiles: ['config/vitest/setup.ts'],
coverage: {
include: ['src/**/*.[jt]s?(x)'],
exclude: ['src/**/?(*.).test.[jt]s?(x)', 'src/mocks/**', 'src/utils/spec.tsx', 'src/config.ts'],
all: true,
reportsDirectory: 'test-reports',
reporter: [
[process.env.CI ? 'cobertura' : 'text'],
[
'html',
{
subdir: 'coverage',
},
],
],
},
mockReset: true,
resolveSnapshotPath: (path: string, extension: string) => `${path}${extension}`,
},
})) When I run Based on the error message, the Thank you all for your time and the amazing work you are doing. 🙂 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Try running |
Beta Was this translation helpful? Give feedback.
@andrewjtorres #3917