Skip to content

Commit 1567992

Browse files
committed
docs(cn): dissolve the conflict
1 parent 03a8845 commit 1567992

7 files changed

Lines changed: 7 additions & 30 deletions

File tree

api/assert.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# assert
22

33
Vitest 从 [`chai`](https://www.chaijs.com/api/assert/) 重新导出了 `assert` 方法,用于验证不变量。
4-
4+
<!-- TODO: translation -->
55
::: warning In-Source Testing {#in-source-testing}
66
When using [assertion functions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions) such as `assert` from `import.meta.vitest` in [in-source tests](/guide/in-source), TypeScript reports error `TS2775` because they must be called via an explicitly annotated name. Annotate the variable with `Chai.Assert` or call it directly:
77

config/repeats.md

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

66
# repeats
7-
7+
<!-- TODO: translation -->
88
- **Type:** `number`
99
- **Default:** `0`
1010
- **CLI:** `--repeats=<number>`

guide/browser/index.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,13 +118,7 @@ export default defineConfig({
118118
```
119119

120120
::: info
121-
<<<<<<< HEAD
122121
Vitest 默认分配端口号 `63315` 以避免与开发服务器冲突,允许我们同时并行运行两者。我们可以通过 [`browser.api`](/config/browser/api) 选项来更改这个端口号。
123-
124-
CLI 不会自动打印 Vite 服务器 URL。在观察模式下运行时,你可以按 "b" 键来打印 URL。
125-
=======
126-
Vitest assigns port `63315` to avoid conflicts with the development server, allowing you to run both in parallel. You can change that with the [`browser.api`](/config/browser/api) option.
127-
>>>>>>> 8430ac3c5895ab2beaa27433b4386989c69fc6ee
128122
:::
129123

130124
如果之前未使用过 Vite,请确保已安装框架插件并在配置中指定。有些框架可能需要额外配置才能运行,请查看其 Vite 相关文档以确定。

guide/cli-generated.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ UI 模式和 HTML 报告器中提供的 HTML 覆盖率输出目录。
636636
- **配置:** [retry.condition](/config/retry#retry-condition)
637637

638638
触发重试操作的错误信息匹配正则表达式。仅当错误信息符合该模式时才会执行重试(默认值:所有错误都会触发重试)
639-
639+
<!-- TODO: translation -->
640640
### repeats
641641

642642
- **CLI:** `--repeats <number>`

guide/in-source.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,16 +154,12 @@ module.exports = {
154154
```
155155

156156
完整的示例请参考 [`examples/in-source-test`](https://github.com/vitest-dev/vitest/tree/main/examples/in-source-test)
157-
158-
<<<<<<< HEAD
159-
## 说明 {#notes}
160-
=======
157+
<!-- TODO: translation -->
161158
::: warning
162159
There is a limitation when using [assertion functions](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-7.html#assertion-functions) such as `assert` in in-source tests. See [`assert`](/api/assert#in-source-testing) for details and workarounds.
163160
:::
164161

165-
## Notes
166-
>>>>>>> 8430ac3c5895ab2beaa27433b4386989c69fc6ee
162+
## 说明 {#notes}
167163

168164
此功能可用于:
169165

guide/learn/setup-teardown.md

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,12 @@ test('can remove an item', () => {
4141
test('can add an item', () => {
4242
items.push('date')
4343
expect(items).toHaveLength(4)
44-
<<<<<<< HEAD
45-
// afterEach 会为下一个测试重置项目,
46-
// 因此此处的修改不会影响到其他测试
47-
})
48-
```
49-
50-
如果没有这些钩子,第二个测试的 `push` 操作会影响其后的所有测试,这是导致测试不稳定的典型原因。这些钩子确保了每个测试都拥有干净的状态。
51-
=======
5244
// beforeEach reset the array to 3 items before this test ran,
5345
// proving that mutations from the previous test do not leak.
5446
})
5547
```
56-
48+
<!-- TODO: translation -->
5749
Without these hooks, mutations like `pop` or `push` from earlier tests would affect subsequent ones, which is a classic source of flaky tests, while the hooks guarantee clean state for every test.
58-
>>>>>>> 8430ac3c5895ab2beaa27433b4386989c69fc6ee
5950

6051
## 一次性初始化 {#one-time-setup}
6152

guide/migration.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,17 +138,13 @@ $ cd subdir && vitest --config ../vitest.config.ts # [!code ++]
138138

139139
Assignments to properties on `globalThis` or `window` in `jsdom` and `happy-dom` environments are now propagated to the underlying DOM implementation. Mutable properties such as `innerWidth` can affect APIs implemented by the DOM environment, for example `happy-dom`'s `matchMedia`.
140140

141-
<<<<<<< HEAD
142-
## 迁移至 Vitest 4.0 {#vitest-4}
143-
=======
144141
### Browser Orchestrator URL Requires a Session
145142

146143
Vitest no longer serves the browser orchestrator UI from a bare `/__vitest_test__/` URL. Browser runner URLs are now session-bound and must include the `sessionId` generated by Vitest, for example `/__vitest_test__/?sessionId=...`.
147144

148145
If you manually opened the browser preview by copying the Vite server URL or visiting `/__vitest_test__/` directly, use the URL opened or printed by Vitest instead.
149146

150-
## Migrating to Vitest 4.0 {#vitest-4}
151-
>>>>>>> 8430ac3c5895ab2beaa27433b4386989c69fc6ee
147+
## 迁移至 Vitest 4.0 {#vitest-4}
152148

153149
::: warning 前提条件
154150
Vitest 4.0 要求 **Vite >= 6.0.0****Node.js >= 20.0.0**

0 commit comments

Comments
 (0)