Skip to content

Commit 71409c3

Browse files
authored
chore(tests): Fix coverage file exclusions (#15944)
When running some unit tests locally, I noticed that the coverage summary contained files like `vite.config.ts` or `.eslintrc` as well as transpiled code in `build`. These files shouldn't be in the coverage reports and neither have an influence on the overall coverage score.
1 parent 305df9f commit 71409c3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

vite/vite.config.ts

+10
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ export default defineConfig({
88
coverage: {
99
enabled: true,
1010
reportsDirectory: './coverage',
11+
exclude: [
12+
'**/node_modules/**',
13+
'**/test/**',
14+
'**/tests/**',
15+
'**/__tests__/**',
16+
'**/rollup*.config.*',
17+
'**/build/**',
18+
'.eslint*',
19+
'vite.config.*',
20+
],
1121
},
1222
reporters: ['default', ...(process.env.CI ? [['junit', { classnameTemplate: '{filepath}' }]] : [])],
1323
outputFile: {

0 commit comments

Comments
 (0)