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
+21-6
Original file line number
Diff line number
Diff line change
@@ -1481,7 +1481,26 @@ Do not show files with 100% statement, branch, and function coverage.
1481
1481
1482
1482
#### coverage.thresholds
1483
1483
1484
-
Options for coverage thresholds
1484
+
Options for coverage thresholds.
1485
+
1486
+
If a threshold is set to a positive number, it will be interpreted as the minimum percentage of coverage required. For example, setting the lines threshold to `90` means that 90% of lines must be covered.
1487
+
1488
+
If a threshold is set to a negative number, it will be treated as the maximum number of uncovered items allowed. For example, setting the lines threshold to `-10` means that no more than 10 lines may be uncovered.
1489
+
1490
+
<!-- eslint-skip -->
1491
+
```ts
1492
+
{
1493
+
coverage: {
1494
+
thresholds: {
1495
+
// Requires 90% function coverage
1496
+
functions: 90,
1497
+
1498
+
// Require that no more than 10 lines are uncovered
1499
+
lines: -10,
1500
+
}
1501
+
}
1502
+
}
1503
+
```
1485
1504
1486
1505
##### coverage.thresholds.lines
1487
1506
@@ -1490,7 +1509,6 @@ Options for coverage thresholds
1490
1509
-**CLI:**`--coverage.thresholds.lines=<number>`
1491
1510
1492
1511
Global threshold for lines.
1493
-
See [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-thresholds) for more information.
1494
1512
1495
1513
##### coverage.thresholds.functions
1496
1514
@@ -1499,7 +1517,6 @@ See [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-threshol
Update all threshold values `lines`, `functions`, `branches` and `statements` to configuration file when current coverage is above the configured thresholds.
1553
+
Update all threshold values `lines`, `functions`, `branches` and `statements` to configuration file when current coverage is better than the configured thresholds.
1539
1554
This option helps to maintain thresholds when coverage is improved.
0 commit comments