Skip to content

Commit 70440c7

Browse files
committed
docs(cn): dissolve the conflict
1 parent faaee69 commit 70440c7

3 files changed

Lines changed: 6 additions & 18 deletions

File tree

guide/extending-matchers.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,12 @@ function customMatcher(this: MatcherState, received: unknown, arg1: unknown, arg
107107

108108
expect.extend({ customMatcher })
109109
```
110-
111-
<<<<<<< HEAD
112-
断言方法可以访问上下文 `this` 对象中的这些属性:
113-
=======
110+
<!-- TODO: translation -->
114111
::: tip
115112
To build custom **snapshot matchers** (wrappers around `toMatchSnapshot` / `toMatchInlineSnapshot` / `toMatchFileSnapshot`), use the composable functions from `vitest/runtime`. See [Custom Snapshot Matchers](/guide/snapshot#custom-snapshot-matchers).
116113
:::
117114

118-
Matcher function has access to `this` context with the following properties:
119-
>>>>>>> 7bcfba99069917ceca25fdcb80d58c38fdcd7233
115+
断言方法可以访问上下文 `this` 对象中的这些属性:
120116

121117
## `isNot`
122118

guide/migration.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,7 @@ export default defineConfig({
640640
```
641641

642642
否则快照中会出现大量转义的 `"` 字符。
643-
644-
<<<<<<< HEAD
645-
## 从 Mocha + Chai + Sinon 迁移 {#mocha-chai-sinon}
646-
=======
643+
<!-- TODO: translation -->
647644
### Custom Snapshot Matchers <Badge type="warning">experimental</Badge> <Version>4.1.3</Version>
648645

649646
Jest imports snapshot composables from `jest-snapshot`. In Vitest, import from `vitest/runtime` instead:
@@ -674,8 +671,7 @@ expect.extend({
674671

675672
See [Custom Snapshot Matchers](/guide/snapshot#custom-snapshot-matchers) for the full guide.
676673

677-
## Migrating from Mocha + Chai + Sinon {#mocha-chai-sinon}
678-
>>>>>>> 7bcfba99069917ceca25fdcb80d58c38fdcd7233
674+
## 从 Mocha + Chai + Sinon 迁移 {#mocha-chai-sinon}
679675

680676
Vitest 对从 Mocha+Chai+Sinon 测试套件迁移提供了完善支持。虽然 Vitest 默认使用与 Jest 兼容的 API,但它同时也提供 Chai 风格的断言用于 spy/mock 测试,从而降低迁移成本。
681677

guide/snapshot.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,10 +192,7 @@ Pretty foo: Object {
192192
```
193193

194194
我们使用的是 Jest 的 `pretty-format` 来序列化快照。你可以在这里阅读更多相关内容:[pretty-format](https://github.com/facebook/jest/blob/main/packages/pretty-format/README.md#serialize).
195-
196-
<<<<<<< HEAD
197-
## 与 Jest 的区别 {#difference-from-jest}
198-
=======
195+
<!-- TODO: translation -->
199196
## Custom Snapshot Matchers <Badge type="warning">experimental</Badge> <Version>4.1.3</Version> {#custom-snapshot-matchers}
200197

201198
You can build custom snapshot matchers using the composable functions exported from `vitest/runtime`. These let you transform values before snapshotting while preserving full snapshot lifecycle support (creation, update, inline rewriting).
@@ -266,8 +263,7 @@ declare module 'vitest' {
266263
See [Extending Matchers](/guide/extending-matchers) for more on `expect.extend` and custom matcher conventions.
267264
:::
268265

269-
## Difference from Jest
270-
>>>>>>> 7bcfba99069917ceca25fdcb80d58c38fdcd7233
266+
## 与 Jest 的区别 {#difference-from-jest}
271267

272268
Vitest 提供了与 [Jest](https://jestjs.io/docs/snapshot-testing) 几乎兼容的快照功能,除少数例外:
273269

0 commit comments

Comments
 (0)