@@ -1488,14 +1488,11 @@ Vitest 会自动将测试文件的 `include` 模式添加到 `coverage.exclude`
1488
1488
1489
1489
#### coverage.thresholds
1490
1490
1491
- <<<<<<< HEAD
1492
- 覆盖范围阈值选项
1493
- =======
1494
- Options for coverage thresholds.
1491
+ 覆盖率阈值选项。
1495
1492
1496
- 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.
1493
+ 如果将阈值设置为正数,则将其解释为所需的最小覆盖率百分比。例如,将行阈值设置为 ` 90 ` 意味着必须覆盖 90% 的行。
1497
1494
1498
- 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.
1495
+ 如果将阈值设置为负数,则将其视为允许的最大未覆盖项数量。例如,将行阈值设置为 ` -10 ` 意味着未覆盖的行数不得超过 10 行。
1499
1496
1500
1497
<!-- eslint-skip -->
1501
1498
``` ts
@@ -1511,59 +1508,38 @@ If a threshold is set to a negative number, it will be treated as the maximum nu
1511
1508
}
1512
1509
}
1513
1510
```
1514
- >>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
1515
1511
1516
1512
##### coverage.thresholds.lines
1517
1513
1518
1514
- ** 类型:** ` number `
1519
1515
- ** 可用的测试提供者:** ` 'v8' | 'istanbul' `
1520
1516
- ** 命令行终端:** ` --coverage.thresholds.lines=<number> `
1521
1517
1522
- <<<<<<< HEAD
1523
1518
lines 的全局阈值。
1524
- 更多信息请查看 [ istanbul documentation] ( https://github.com/istanbuljs/nyc#coverage-thresholds ) 。
1525
- =======
1526
- Global threshold for lines.
1527
- >>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
1528
1519
1529
1520
##### coverage.thresholds.functions
1530
1521
1531
1522
- ** 类型:** ` number `
1532
1523
- ** 可用的测试提供者:** ` 'v8' | 'istanbul' `
1533
1524
- ** 命令行终端:** ` --coverage.thresholds.functions=<number> `
1534
1525
1535
- <<<<<<< HEAD
1536
1526
functions 的全局阈值。
1537
- 更多信息请查看 [ istanbul documentation] ( https://github.com/istanbuljs/nyc#coverage-thresholds ) 。
1538
- =======
1539
- Global threshold for functions.
1540
- >>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
1541
1527
1542
1528
##### coverage.thresholds.branches
1543
1529
1544
1530
- ** 类型:** ` number `
1545
1531
- ** 可用的测试提供者:** ` 'v8' | 'istanbul' `
1546
1532
- ** 命令行终端:** ` --coverage.thresholds.branches=<number> `
1547
1533
1548
- <<<<<<< HEAD
1549
1534
branches 的全局阈值。
1550
- 更多信息请查看 [ istanbul documentation] ( https://github.com/istanbuljs/nyc#coverage-thresholds ) 。
1551
- =======
1552
- Global threshold for branches.
1553
- >>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
1554
1535
1555
1536
##### coverage.thresholds.statements
1556
1537
1557
1538
- ** 类型:** ` number `
1558
1539
- ** 可用的测试提供者:** ` 'v8' | 'istanbul' `
1559
1540
- ** 命令行终端:** ` --coverage.thresholds.statements=<number> `
1560
1541
1561
- <<<<<<< HEAD
1562
1542
statements 的全局阈值。
1563
- 更多信息请查看 [ istanbul documentation] ( https://github.com/istanbuljs/nyc#coverage-thresholds ) 。
1564
- =======
1565
- Global threshold for statements.
1566
- >>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
1567
1543
1568
1544
##### coverage.thresholds.perFile
1569
1545
@@ -1581,13 +1557,8 @@ Global threshold for statements.
1581
1557
- ** 可用的测试提供者:** ` 'v8' | 'istanbul' `
1582
1558
- ** 命令行终端:** ` --coverage.thresholds.autoUpdate=<boolean> `
1583
1559
1584
- <<<<<<< HEAD
1585
- 如果当前覆盖率高于配置的阈值时,将所有阈值 ` lines ` 、` functions ` 、` branches ` 和 ` statements ` 更新到配置文件中。
1586
- 此选项有助于在覆盖率提高时保持阈值不变。
1587
- =======
1588
- Update all threshold values ` lines ` , ` functions ` , ` branches ` and ` statements ` to configuration file when current coverage is better than the configured thresholds.
1589
- This option helps to maintain thresholds when coverage is improved.
1590
- >>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
1560
+ 当当前覆盖率优于配置的阈值时,将所有阈值 ` lines ` 、` functions ` 、` branches ` 和 ` statements ` 更新到配置文件中。
1561
+ 此选项有助于在覆盖率提高时维护阈值。
1591
1562
1592
1563
##### coverage.thresholds.100
1593
1564
@@ -1608,8 +1579,8 @@ This option helps to maintain thresholds when coverage is improved.
1608
1579
设置与 glob 模式匹配的文件的阈值。
1609
1580
1610
1581
::: tip NOTE
1611
- Vitest counts all files, including those covered by glob-patterns, into the global coverage thresholds.
1612
- This is different from Jest behavior.
1582
+ Vitest 会将所有文件,包括那些被 glob 模式覆盖的文件,计入全局覆盖率阈值。
1583
+ 这与 Jest 的行为不同。
1613
1584
:::
1614
1585
1615
1586
<!-- eslint-skip -->
0 commit comments