Skip to content

Commit 1109755

Browse files
NoiseFanweb3Worker-xweb3Worker-xHHG66z-kunf
authored
docs(cn): release merge into dev @6a59445f (#874)
* docs(coverage): update guide/coverage.md (#845) * docs(timer): update /mocking/timer comment 修改 [/mocking/timer](https://cn.vitest.dev/guide/mocking/timers.html#example) 未翻译的注释 * docs(coverage): update guide/coverage.md --------- Co-authored-by: NoiseFan <[email protected]> Co-authored-by: web3Worker-x <[email protected]> * Modify the v3 guide link in mocking-classes * docs: translate /guide/mocking/classes (#849) * docs(timer): update /mocking/timer comment 修改 [/mocking/timer](https://cn.vitest.dev/guide/mocking/timers.html#example) 未翻译的注释 * docs(classes): Add translate --------- Co-authored-by: NoiseFan <[email protected]> * Modify the v3 guide link in mocking-classes * docs(reporters): fix link formatting issues in the document (#848) * docs(timer): update /mocking/timer comment 修改 [/mocking/timer](https://cn.vitest.dev/guide/mocking/timers.html#example) 未翻译的注释 * docs(reporters): fix link formatting issues in the document * docs(reporters): fix link formatting issues in the document --------- Co-authored-by: NoiseFan <[email protected]> * docs(cn): update menu item translate (#846) * docs(timer): update /mocking/timer comment 修改 [/mocking/timer](https://cn.vitest.dev/guide/mocking/timers.html#example) 未翻译的注释 * docs(cn): update menu item translate --------- Co-authored-by: NoiseFan <[email protected]> * docs(cn): update testTimeout default value and description (#851) * docs(timer): update /mocking/timer comment 修改 [/mocking/timer](https://cn.vitest.dev/guide/mocking/timers.html#example) 未翻译的注释 * docs: update testTimeout default value and description * Update config/testtimeout.md Co-authored-by: NoiseFan <[email protected]> --------- Co-authored-by: NoiseFan <[email protected]> * docs(runner): update /config/runner.md (#853) * docs(benchmark): update config/benchmark description (#856) * docs(benchmark): update config/benchmark description * Update config/benchmark.md Co-authored-by: Copilot <[email protected]> * Update config/benchmark.md Co-authored-by: Copilot <[email protected]> * Update config/benchmark.md Co-authored-by: Copilot <[email protected]> --------- Co-authored-by: Kylin <[email protected]> Co-authored-by: Copilot <[email protected]> * docs(guide/advanced/reporters): update comment for MyDefaultReporter (#859) * docs(fileparallelism): translate config/fileparallelism * docs(fileparallelism): translate config/fileparallelism * Update config/fileparallelism.md * docs(watch): update /config/watch comment (#852) * docs(watch): update /config/watch comment * Update config/watch.md Co-authored-by: NoiseFan <[email protected]> * Update config/watch.md Co-authored-by: NoiseFan <[email protected]> --------- Co-authored-by: thinkasany <[email protected]> Co-authored-by: NoiseFan <[email protected]> * docs(testnamepattern): translate config/testnamepattern (#855) * docs(testnamepattern): translate config/testnamepattern * docs(testnamepattern): translate config/testnamepattern * docs(testnamepattern): translate config/testnamepattern * docs(config): Translate the setupfiles.md document into Chinese. (#857) * docs(reporters): fix link formatting issues in the document * docs(reporters): fix link formatting issues in the document * docs(config): Translate the setupfiles.md document into Chinese. * docs(config): Translate the setupfiles.md document into Chinese. * docs(execargy): translate config/execargv.md (#861) * docs(execargy): translate config/execargv.md * docs(cn): update /config/execargv --------- Co-authored-by: noise <[email protected]> * docs(execargy): translate config/execargv.md (#862) * docs(execargy): translate config/execargv.md (#863) * docs(cn): fix `/api/advanced/test-case` formatter (#865) Co-authored-by: 黄冬 <[email protected]> * docs(hookTimeout): translate /config/hookTimeout.md (#866) * docs(hookTimeout): translate /config/hookTimeout.md * Update config/hooktimeout.md --------- Co-authored-by: NoiseFan <[email protected]> * docs(config): correct Chinese translation in themeConfig (#864) * docs(cn): update the translation of the untubeEnvs configuration document (#869) * docs(cn): Update the translation of the untubeEnvs configuration document * docs: typo * docs(locators): translate /config/browser/locators.md (#870) * docs(viewport): translate /config/browser/viewport.md (#872) * docs(cn): update /guide/brower/why (#871) * docs(screenshotDirectory): translate /config/screenshotDirectory.md (#873) --------- Co-authored-by: web3Worker-x <[email protected]> Co-authored-by: web3Worker-x <[email protected]> Co-authored-by: 韩宏广 <[email protected]> Co-authored-by: 卡 <[email protected]> Co-authored-by: ChengYanqi <[email protected]> Co-authored-by: WuPeiM <[email protected]> Co-authored-by: faluoys <[email protected]> Co-authored-by: duyidao <[email protected]> Co-authored-by: Glue6 <[email protected]> Co-authored-by: Kylin <[email protected]> Co-authored-by: Copilot <[email protected]> Co-authored-by: wshiqyuan <[email protected]> Co-authored-by: tz200 <[email protected]> Co-authored-by: thinkasany <[email protected]> Co-authored-by: 草莓啵啵奶 <[email protected]> Co-authored-by: zyear <[email protected]> Co-authored-by: ITHDD <[email protected]> Co-authored-by: 黄冬 <[email protected]> Co-authored-by: QmAhaha <[email protected]> Co-authored-by: wshiqyuan <[email protected]>
1 parent fda2d97 commit 1109755

File tree

21 files changed

+91
-89
lines changed

21 files changed

+91
-89
lines changed

.vitepress/config.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ export default ({ mode }: { mode: string }) => {
110110
},
111111
themeConfig: {
112112
logo: '/logo.svg',
113-
113+
lastUpdatedText: '最后更新',
114+
docFooter: {
115+
prev: '上一页',
116+
next: '下一页',
117+
},
114118
editLink: {
115119
pattern: 'https://github.com/vitest-dev/docs-cn/edit/dev/:path',
116120
text: '在 GitHub 上编辑此页面',
@@ -212,7 +216,7 @@ export default ({ mode }: { mode: string }) => {
212216
collapsed: false,
213217
items: [
214218
{
215-
text: 'Config File',
219+
text: '配置文件',
216220
link: '/config/',
217221
},
218222
{

api/advanced/test-case.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ function ok(): boolean
126126
function meta(): TaskMeta
127127
```
128128

129-
在测试执行期间附加到测试上的自定义[元数据](/api/advanced/metadata)。我们可以在测试运行期间通过给 `ctx.task.meta` 对象分配属性来附加元数据。
129+
在测试执行期间附加到测试上的自定义 [元数据](/api/advanced/metadata)。我们可以在测试运行期间通过给 `ctx.task.meta` 对象分配属性来附加元数据。
130130

131131
```ts {3,6}
132132
import { test } from 'vitest'

config/benchmark.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,66 @@ outline: deep
55

66
# benchmark <Experimental /> {#benchmark}
77

8-
- **Type:** `{ include?, exclude?, ... }`
8+
- **类型:** `{ include?, exclude?, ... }`
99

10-
Options used when running `vitest bench`.
10+
运行 `vitest bench` 时使用的选项。
1111

1212
## benchmark.include
1313

14-
- **Type:** `string[]`
15-
- **Default:** `['**/*.{bench,benchmark}.?(c|m)[jt]s?(x)']`
14+
- **类型:** `string[]`
15+
- **默认值:** `['**/*.{bench,benchmark}.?(c|m)[jt]s?(x)']`
1616

17-
Include globs for benchmark test files
17+
匹配包含基准测试文件的 glob 规则。
1818

1919
## benchmark.exclude
2020

21-
- **Type:** `string[]`
22-
- **Default:** `['node_modules', 'dist', '.idea', '.git', '.cache']`
21+
- **类型:** `string[]`
22+
- **默认值:** `['node_modules', 'dist', '.idea', '.git', '.cache']`
2323

24-
Exclude globs for benchmark test files
24+
匹配排除基准测试文件的 glob 规则。
2525

2626
## benchmark.includeSource
2727

28-
- **Type:** `string[]`
29-
- **Default:** `[]`
28+
- **类型:** `string[]`
29+
- **默认值:** `[]`
3030

31-
Include globs for in-source benchmark test files. This option is similar to [`includeSource`](#includesource).
31+
匹配包含内联基准测试文件的 glob 规则。此选项类似于 [`includeSource`](#includesource)
3232

33-
When defined, Vitest will run all matched files with `import.meta.vitest` inside.
33+
定义后,Vitest 将运行所有匹配的文件,其中包含 `import.meta.vitest`
3434

3535
## benchmark.reporters
3636

37-
- **Type:** `Arrayable<BenchmarkBuiltinReporters | Reporter>`
38-
- **Default:** `'default'`
37+
- **类型:** `Arrayable<BenchmarkBuiltinReporters | Reporter>`
38+
- **默认值:** `'default'`
3939

40-
Custom reporter for output. Can contain one or more built-in report names, reporter instances, and/or paths to custom reporters.
40+
用于定义输出的自定义报告器。它可以包含一个或多个内置报告名称、报告实例和(或)自定义报告的路径。
4141

4242
## benchmark.outputFile
4343

44-
Deprecated in favor of `benchmark.outputJson`.
44+
已弃用,建议使用 `benchmark.outputJson`
4545

4646
## benchmark.outputJson {#benchmark-outputJson}
4747

48-
- **Type:** `string | undefined`
49-
- **Default:** `undefined`
48+
- **类型:** `string | undefined`
49+
- **默认值:** `undefined`
5050

51-
A file path to store the benchmark result, which can be used for `--compare` option later.
51+
存储基准测试结果的文件路径,可用于稍后的 `--compare` 选项。
5252

53-
For example:
53+
例如:
5454

5555
```sh
56-
# save main branch's result
56+
# 保存主分支的结果
5757
git checkout main
5858
vitest bench --outputJson main.json
5959

60-
# change a branch and compare against main
60+
# 切换到另一个分支并与主分支进行比较
6161
git checkout feature
6262
vitest bench --compare main.json
6363
```
6464

6565
## benchmark.compare {#benchmark-compare}
6666

67-
- **Type:** `string | undefined`
68-
- **Default:** `undefined`
67+
- **类型:** `string | undefined`
68+
- **默认值:** `undefined`
6969

70-
A file path to a previous benchmark result to compare against current runs.
70+
用于与当前运行结果进行比较的先前基准测试结果的文件路径。

config/browser/locators.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ outline: deep
55

66
# browser.locators
77

8-
Options for built-in [browser locators](/api/browser/locators).
8+
内置 [浏览器定位器](/api/browser/locators) 的选项。
99

1010
## browser.locators.testIdAttribute
1111

12-
- **Type:** `string`
13-
- **Default:** `data-testid`
12+
- **类型:** `string`
13+
- **默认值:** `data-testid`
1414

15-
Attribute used to find elements with `getByTestId` locator.
15+
用于通过 `getByTestId` 定位器查找元素的属性。

config/browser/screenshotdirectory.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ outline: deep
55

66
# browser.screenshotDirectory
77

8-
- **Type:** `string`
9-
- **Default:** `__screenshots__` in the test file directory
8+
- **类型:** `string`
9+
- **默认值:** 测试文件目录中的 `__screenshots__`
1010

11-
Path to the screenshots directory relative to the `root`.
11+
相对于 `root` 的屏幕截图目录路径。

config/browser/viewport.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ outline: deep
55

66
# browser.viewport
77

8-
- **Type:** `{ width, height }`
9-
- **Default:** `414x896`
8+
- **类型:** `{ width, height }`
9+
- **默认值:** `414x896`
1010

11-
Default iframe's viewport.
11+
默认 `iframe` 的视口。

config/execargv.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ outline: deep
55

66
# execArgv
77

8-
- **Type:** `string[]`
9-
- **Default:** `[]`
8+
- **类型:** `string[]`
9+
- **默认值:** `[]`
1010

11-
Pass additional arguments to `node` in the runner worker. See [Command-line API | Node.js](https://nodejs.org/docs/latest/api/cli.html) for more information.
11+
向运行器工作线程中 `node` 传递额外参数,请参阅 [Command-line API | Node.js](https://nodejs.org/docs/latest/api/cli.html)
1212

1313
:::warning
14-
Be careful when using, it as some options may crash worker, e.g. `--prof`, `--title`. See https://github.com/nodejs/node/issues/41103.
14+
使用时要小心,因为某些选项(如 `--prof` `--title`)可能会导致 `worker` 崩溃。更多内容请参阅 https://github.com/nodejs/node/issues/41103
1515
:::

config/fileparallelism.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ outline: deep
55

66
# fileParallelism
77

8-
- **Type:** `boolean`
9-
- **Default:** `true`
10-
- **CLI:** `--no-file-parallelism`, `--fileParallelism=false`
8+
- **类型:** `boolean`
9+
- **默认值:** `true`
10+
- **命令行终端:** `--no-file-parallelism`, `--fileParallelism=false`
1111

12-
Should all test files run in parallel. Setting this to `false` will override `maxWorkers` option to `1`.
12+
所有测试文件应该并行运行。 将其设置为 `false` 将覆盖 `maxWorkers` 选项为 `1`
1313

1414
::: tip
15-
This option doesn't affect tests running in the same file. If you want to run those in parallel, use `concurrent` option on [describe](/api/#describe-concurrent) or via [a config](#sequence-concurrent).
15+
此选项不会影响在同一文件中运行的测试。如果你想并行运行这些程序,使用 `concurrent` 选项 [describe](/api/#describe-concurrent) 或通过 [配置](#sequence-concurrent)
1616
:::

config/hooktimeout.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ outline: deep
55

66
# hookTimeout
77

8-
- **Type:** `number`
9-
- **Default:** `10_000` in Node.js, `30_000` if `browser.enabled` is `true`
10-
- **CLI:** `--hook-timeout=10000`, `--hookTimeout=10000`
8+
- **类型:** `number`
9+
- **默认值:** Node.js 环境下为 `10_000`,当 `browser.enabled` `true` 时为 `30_000`
10+
- **命令行终端:** `--hook-timeout=10000``--hookTimeout=10000`
1111

12-
Default timeout of a hook in milliseconds. Use `0` to disable timeout completely.
12+
钩子 (`hook`) 的默认超时时间 (以毫秒为单位)。使用 `0` 完全禁用超时。

config/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
outline: deep
33
---
44

5-
# 配置索引 {#configuring-vitest}
5+
# 配置 Vitest {#configuring-vitest}
66

77
如果我们正在使用 Vite 并且拥有一个 `vite.config` 文件,Vitest 会读取它来匹配我们的 Vite 应用的插件和设置。如果我们想要为测试配置不同的设置,或者我们的并不特别依赖于 Vite,我们我们可以选择:
88

0 commit comments

Comments
 (0)