Skip to content

Commit 9e63222

Browse files
committed
docs(cn): conflict resolution
1 parent 18fb4c5 commit 9e63222

File tree

4 files changed

+15
-24
lines changed

4 files changed

+15
-24
lines changed

config/index.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ Vite 将处理内联模块。这可能有助于处理以 ESM 格式传送 `.js`
249249
:::
250250

251251
#### deps.web <Badge type="info">0.34.2+</Badge>
252+
252253
#### deps.web
253254

254255
- **类型:** `{ transformAssets?, ... }`
@@ -434,7 +435,6 @@ Vitest 使用 Vite SSR 基元来运行测试,这有[一定的缺陷](https://v
434435
3. 如果您要别名外部依赖(例如,`react` -> `preact`),您可能需要别名实际的 `node_modules` 包,以使其适用于外部依赖。[Yarn](https://classic.yarnpkg.com/en/docs/cli/add/#toc-yarn-add-alias)[pnpm](https://pnpm.io/aliases/) 都支持通过 `npm:` 前缀进行别名。
435436
:::
436437

437-
438438
### globals
439439

440440
- **类型:** `boolean`
@@ -1749,11 +1749,11 @@ export default defineConfig({
17491749

17501750
#### browser.ui {#browser-ui}
17511751

1752-
- **Type:** `boolean`
1753-
- **Default:** `!isCI`
1754-
- **CLI:** `--browser.ui=false`
1752+
- **类型:** `boolean`
1753+
- **默认值:** `!isCI`
1754+
- **命令行终端:** `--browser.ui=false`
17551755

1756-
Should Vitest UI be injected into the page. By default, injects UI iframe during development.
1756+
是否应该将 Vitest UI 注入到页面中。默认情况下,在开发过程中注入 UI iframe
17571757

17581758
#### browser.indexScripts {#browser-indexscripts}
17591759

guide/features.md

+1-6
Original file line numberDiff line numberDiff line change
@@ -247,17 +247,12 @@ test('my types work properly', () => {
247247

248248
## 分片
249249

250-
<<<<<<< HEAD
251250
使用 [`--shard`](/guide/cli#shard)[`--reporter=blob`](/guide/reporters#blob-reporter)标志在不同的计算机上运行测试。可以使用 `--merge-reports` 命令在 CI 管道的末尾合并所有测试结果:
252-
=======
253-
Run tests on different machines using [`--shard`](/guide/cli#shard) and [`--reporter=blob`](/guide/reporters#blob-reporter) flags.
254-
All test and coverage results can be merged at the end of your CI pipeline using `--merge-reports` command:
255-
>>>>>>> 6d8f5db48f0b71948ed551f8b3001ef1fe5cae99
256251

257252
```bash
258253
vitest --shard=1/2 --reporter=blob
259254
vitest --shard=2/2 --reporter=blob
260255
vitest --merge-reports --reporter=junit --coverage.reporter=text
261256
```
262257

263-
See [`Improving Performance | Sharding`](/guide/improving-performance#sharding) for more information.
258+
了解更多信息 [`性能优化 | 分片`](/guide/improving-performance#sharding)

guide/improving-performance.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -88,17 +88,17 @@ export default defineConfig({
8888

8989
## Sharding
9090

91-
Test sharding means running a small subset of test cases at a time. It can be useful when you have multiple machines that could be used to run tests simultaneously.
91+
测试分片意味着一次运行一小部分测试用例。当你有多台可用于同时运行测试的机器时,它会很有用。
9292

93-
To split Vitest tests on multiple different runs, use [`--shard`](/guide/cli#shard) option with [`--reporter=blob`](/guide/reporters#blob-reporter) option:
93+
要在多个不同的运行中拆分 Vitest 测试,请将 [`--shard`](/guide/cli#shard) 选项与 [`--reporter=blob`](/guide/reporters#blob-reporter) 选项一起使用:
9494

9595
```sh
9696
vitest run --reporter=blob --shard=1/3 # 1st machine
9797
vitest run --reporter=blob --shard=2/3 # 2nd machine
9898
vitest run --reporter=blob --shard=3/3 # 3rd machine
9999
```
100100

101-
Collect the results stored in `.vitest-reports` directory from each machine and merge them with [`--merge-reports`](/guide/cli#merge-reports) option:
101+
从每台计算机收集存储在 `.vitest-reports` 目录中的结果,并使用 [`--merge-reports`](/guide/cli#merge-reports) 选项将其合并:
102102

103103
```sh
104104
vitest --merge-reports
@@ -177,12 +177,12 @@ jobs:
177177
</details>
178178
179179
:::tip
180-
Test sharding can also become useful on high CPU-count machines.
180+
测试分片在多 CPU 数量的机器上也很有用。
181181
182-
Vitest will run only a single Vite server in its main thread. Rest of the threads are used to run test files.
183-
In a high CPU-count machine the main thread can become a bottleneck as it cannot handle all the requests coming from the threads. For example in 32 CPU machine the main thread is responsible to handle load coming from 31 test threads.
182+
Vitest 将只在其主线程中运行一个 Vite 服务器。其余的线程用于运行测试文件。
183+
在高 CPU 计数的机器中,主线程可能会成为瓶颈,因为它无法处理来自线程的所有请求。例如,在 32 CPU 机器中,主线程负责处理来自 31 个测试线程的负载。
184184
185-
To reduce the load from main thread's Vite server you can use test sharding. The load can be balanced on multiple Vite server.
185+
为了减少主线程的 Vite 服务器的负载,可以使用测试分片。负载可以在多个 Vite 服务器上进行平衡。
186186
187187
```sh
188188
# Example for splitting tests on 32 CPU to 4 shards.

guide/using-plugins.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ title: 使用插件 | 指南
44

55
# 使用插件
66

7-
<<<<<<< HEAD
8-
Vitest 可以使用插件进行扩展...
9-
=======
10-
Vitest can be extended using plugins, similar to how Vite plugins work. This allows you to enhance and customize Vitest's functionality by using the same API and concepts of Vite plugins.
7+
Vitest 可以使用插件进行扩展,类似于 Vite 插件的工作方式。这允许你使用相同的 API 和 Vite 插件概念来增强和自定义 Vitest 的功能。
118

12-
For detailed guidance on how to write plugins, you can refer to the [Vite plugin documentation](https://vitejs.dev/guide/api-plugin).
13-
>>>>>>> 6d8f5db48f0b71948ed551f8b3001ef1fe5cae99
9+
有关如何编写插件的详细指导,你可以参考 [Vite 插件文档](https://vitejs.dev/guide/api-plugin).

0 commit comments

Comments
 (0)