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: website/docs/en/config/test/coverage.mdx
+7-5Lines changed: 7 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -205,6 +205,8 @@ type CoverageThresholds = {
205
205
206
206
Coverage thresholds for enforcing minimum coverage requirements. You can set thresholds for statements, functions, branches, and lines.
207
207
208
+
Thresholds specified as a positive number are taken to be the minimum percentage required. Thresholds specified as a negative number represent the maximum number of uncovered entities allowed.
209
+
208
210
```ts title='rstest.config.ts'
209
211
import { defineConfig } from'@rstest/core';
210
212
@@ -215,7 +217,7 @@ export default defineConfig({
215
217
statements: 80,
216
218
functions: 80,
217
219
branches: 80,
218
-
lines: 80,
220
+
lines: -10,
219
221
},
220
222
},
221
223
});
@@ -224,8 +226,8 @@ export default defineConfig({
224
226
When the code coverage is below the specified thresholds, the test will fail and output an error message like below:
225
227
226
228
```bash
227
-
Coverage for statements 75% does not meet global threshold 80%
228
-
Coverage for functions 75% does not meet global threshold 80%
229
-
Coverage for branches 75% does not meet global threshold 80%
230
-
Coverage for lines 75% does not meet global threshold 80%
229
+
Error: Coverage for statements 75% does not meet global threshold 80%
230
+
Error: Coverage for functions 75% does not meet global threshold 80%
231
+
Error: Coverage for branches 75% does not meet global threshold 80%
232
+
Error: Uncovered lines 20 exceeds maximum global threshold allowed 10
0 commit comments