You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/config/index.md
+4
Original file line number
Diff line number
Diff line change
@@ -1137,6 +1137,10 @@ Clean coverage report on watch rerun
1137
1137
-**Available for providers:**`'v8' | 'istanbul'`
1138
1138
-**CLI:**`--coverage.reportsDirectory=<path>`
1139
1139
1140
+
::: warning
1141
+
Vitest will delete this directory before running tests if `coverage.clean` is enabled (default value).
1142
+
:::
1143
+
1140
1144
Directory to write coverage report to.
1141
1145
1142
1146
To preview the coverage report in the output of [HTML reporter](/guide/reporters.html#html-reporter), this option must be set as a sub-directory of the html report directory (for example `./html/coverage`).
expect(stderr).toMatch(`Error: You cannot set "coverage.reportsDirectory" as ${directory}. Vitest needs to be able to remove this directory before test run`)
87
+
})
88
+
89
+
test('coverage reportsDirectory cannot be root',async()=>{
90
+
const{ stderr }=awaitrunVitest({
91
+
root: './fixtures',
92
+
coverage: {
93
+
enabled: true,
94
+
reportsDirectory: './',
95
+
96
+
// Additional options to make sure this test doesn't accidentally remove whole vitest project
expect(stderr).toMatch(`Error: You cannot set "coverage.reportsDirectory" as ${directory}. Vitest needs to be able to remove this directory before test run`)
106
+
})
107
+
70
108
test('version number is printed when coverage provider fails to load',async()=>{
0 commit comments