Skip to content

Commit f145ceb

Browse files
authored
Merge pull request #559 from lxKylin/sync-a43
docs(cn): translate document
2 parents 2c747cf + 016ef0d commit f145ceb

File tree

2 files changed

+7
-72
lines changed

2 files changed

+7
-72
lines changed

api/index.md

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -152,11 +152,7 @@ test.skipIf(isDev)('prod only test', () => {
152152
```
153153

154154
::: warning
155-
<<<<<<< HEAD
156155
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
157-
=======
158-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
159-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
160156
:::
161157

162158
### test.runIf
@@ -177,11 +173,7 @@ test.runIf(isDev)('dev only test', () => {
177173
```
178174

179175
::: warning
180-
<<<<<<< HEAD
181176
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
182-
=======
183-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
184-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
185177
:::
186178

187179
### test.only
@@ -255,11 +247,7 @@ test.concurrent('test 2', async ({ expect }) => {
255247
```
256248

257249
::: warning
258-
<<<<<<< HEAD
259250
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
260-
=======
261-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
262-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
263251
:::
264252

265253
### test.sequential
@@ -335,11 +323,7 @@ test.fails('fail test', async () => {
335323
```
336324

337325
::: warning
338-
<<<<<<< HEAD
339326
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
340-
=======
341-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
342-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
343327
:::
344328

345329
### test.each
@@ -441,11 +425,7 @@ Vitest 使用 chai `format` 方法处理 `$values`。如果数值太短,可以
441425
:::
442426

443427
::: warning
444-
<<<<<<< HEAD
445428
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
446-
=======
447-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
448-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
449429
:::
450430

451431
### test.for
@@ -862,11 +842,7 @@ describe.runIf(isDev)('dev only test suite', () => {
862842
```
863843

864844
::: warning
865-
<<<<<<< HEAD
866845
将 Vitest 用作[类型检查器](/guide/testing-types)时,你不能使用此语法。
867-
=======
868-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
869-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
870846
:::
871847

872848
### describe.only
@@ -951,11 +927,7 @@ describe.concurrent('suite', () => {
951927
```
952928

953929
::: warning
954-
<<<<<<< HEAD
955930
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
956-
=======
957-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
958-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
959931
:::
960932

961933
### describe.sequential
@@ -1019,11 +991,7 @@ describe.shuffle('suite', () => {
1019991
`.skip``.only``.todo`适用于随机测试套件。
1020992

1021993
::: warning
1022-
<<<<<<< HEAD
1023994
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
1024-
=======
1025-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
1026-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
1027995
:::
1028996

1029997
### describe.todo
@@ -1088,11 +1056,7 @@ describe.each`
10881056
```
10891057

10901058
::: warning
1091-
<<<<<<< HEAD
10921059
在将 Vitest 用作[类型检查器](/guide/testing-types)时,不能使用此语法。
1093-
=======
1094-
You cannot use this syntax when using Vitest as [type checker](/guide/testing-types).
1095-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
10961060
:::
10971061

10981062
## Setup and Teardown

config/index.md

Lines changed: 7 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1488,14 +1488,11 @@ Vitest 会自动将测试文件的 `include` 模式添加到 `coverage.exclude`
14881488

14891489
#### coverage.thresholds
14901490

1491-
<<<<<<< HEAD
1492-
覆盖范围阈值选项
1493-
=======
1494-
Options for coverage thresholds.
1491+
覆盖率阈值选项。
14951492

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% 的行。
14971494

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 行。
14991496

15001497
<!-- eslint-skip -->
15011498
```ts
@@ -1511,59 +1508,38 @@ If a threshold is set to a negative number, it will be treated as the maximum nu
15111508
}
15121509
}
15131510
```
1514-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
15151511

15161512
##### coverage.thresholds.lines
15171513

15181514
- **类型:** `number`
15191515
- **可用的测试提供者:** `'v8' | 'istanbul'`
15201516
- **命令行终端:** `--coverage.thresholds.lines=<number>`
15211517

1522-
<<<<<<< HEAD
15231518
lines 的全局阈值。
1524-
更多信息请查看 [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-thresholds)
1525-
=======
1526-
Global threshold for lines.
1527-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
15281519

15291520
##### coverage.thresholds.functions
15301521

15311522
- **类型:** `number`
15321523
- **可用的测试提供者:** `'v8' | 'istanbul'`
15331524
- **命令行终端:** `--coverage.thresholds.functions=<number>`
15341525

1535-
<<<<<<< HEAD
15361526
functions 的全局阈值。
1537-
更多信息请查看 [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-thresholds)
1538-
=======
1539-
Global threshold for functions.
1540-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
15411527

15421528
##### coverage.thresholds.branches
15431529

15441530
- **类型:** `number`
15451531
- **可用的测试提供者:** `'v8' | 'istanbul'`
15461532
- **命令行终端:** `--coverage.thresholds.branches=<number>`
15471533

1548-
<<<<<<< HEAD
15491534
branches 的全局阈值。
1550-
更多信息请查看 [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-thresholds)
1551-
=======
1552-
Global threshold for branches.
1553-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
15541535

15551536
##### coverage.thresholds.statements
15561537

15571538
- **类型:** `number`
15581539
- **可用的测试提供者:** `'v8' | 'istanbul'`
15591540
- **命令行终端:** `--coverage.thresholds.statements=<number>`
15601541

1561-
<<<<<<< HEAD
15621542
statements 的全局阈值。
1563-
更多信息请查看 [istanbul documentation](https://github.com/istanbuljs/nyc#coverage-thresholds)
1564-
=======
1565-
Global threshold for statements.
1566-
>>>>>>> a237ba4370744b3e72a3043f6b2e9fb64902947d
15671543

15681544
##### coverage.thresholds.perFile
15691545

@@ -1581,13 +1557,8 @@ Global threshold for statements.
15811557
- **可用的测试提供者:** `'v8' | 'istanbul'`
15821558
- **命令行终端:** `--coverage.thresholds.autoUpdate=<boolean>`
15831559

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+
此选项有助于在覆盖率提高时维护阈值。
15911562

15921563
##### coverage.thresholds.100
15931564

@@ -1608,8 +1579,8 @@ This option helps to maintain thresholds when coverage is improved.
16081579
设置与 glob 模式匹配的文件的阈值。
16091580

16101581
::: 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 的行为不同。
16131584
:::
16141585

16151586
<!-- eslint-skip -->

0 commit comments

Comments
 (0)