Skip to content

Commit 1f8967a

Browse files
committed
docs(cn): dissolve the conflict
1 parent 0468f40 commit 1f8967a

13 files changed

Lines changed: 65 additions & 268 deletions

File tree

.vitepress/config.ts

Lines changed: 24 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,9 @@ export default ({ mode }: { mode: string }) => {
808808
docFooterText: '追踪查看器 | 浏览器模式',
809809
},
810810
{
811-
text: 'Playwright Traces',
811+
text: 'Playwright 追踪',
812812
link: '/guide/browser/playwright-traces',
813-
docFooterText: 'Playwright Traces | Browser Mode',
813+
docFooterText: 'Playwright 追踪 | 浏览器模式',
814814
},
815815
{
816816
text: 'ARIA 快照',
@@ -825,43 +825,15 @@ export default ({ mode }: { mode: string }) => {
825825
// write X in a test?" If yes, it belongs here. Mocking sub-pages
826826
// live nested because they're a multi-page subtopic.
827827
{
828-
<<<<<<< HEAD
829-
text: '指南',
828+
text: '编写测试',
830829
collapsed: false,
831830
items: [
832-
{
833-
text: '命令行界面',
834-
link: '/guide/cli',
835-
},
836-
{
837-
text: '测试筛选',
838-
link: '/guide/filtering',
839-
},
840-
{
841-
text: '测试标签',
842-
link: '/guide/test-tags',
843-
},
844831
{
845832
text: '测试上下文',
846833
link: '/guide/test-context',
847834
},
848835
{
849-
text: '测试环境',
850-
link: '/guide/environment',
851-
},
852-
{
853-
text: '测试运行生命周期',
854-
=======
855-
text: 'Authoring',
856-
collapsed: false,
857-
items: [
858-
{
859-
text: 'Test Context',
860-
link: '/guide/test-context',
861-
},
862-
{
863-
text: 'Test Run Lifecycle',
864-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
836+
text: '运行生命周期',
865837
link: '/guide/lifecycle',
866838
},
867839
{
@@ -908,37 +880,8 @@ export default ({ mode }: { mode: string }) => {
908880
],
909881
},
910882
{
911-
<<<<<<< HEAD
912-
text: '并行测试',
913-
link: '/guide/parallelism',
914-
},
915-
{
916-
text: '测试项目',
917-
link: '/guide/projects',
918-
},
919-
{
920-
text: '报告器',
921-
link: '/guide/reporters',
922-
},
923-
{
924-
text: '覆盖率',
925-
link: '/guide/coverage',
926-
},
927-
{
928-
text: '类型测试',
929-
link: '/guide/testing-types',
930-
},
931-
{
932-
text: 'UI 模式',
933-
link: '/guide/ui',
934-
},
935-
{
936-
text: '内联测试',
937-
link: '/guide/in-source',
938-
=======
939-
text: 'Test Tags',
883+
text: '测试',
940884
link: '/guide/test-tags',
941-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
942885
},
943886
{
944887
text: '测试注释',
@@ -949,14 +892,11 @@ export default ({ mode }: { mode: string }) => {
949892
link: '/guide/extending-matchers',
950893
},
951894
{
952-
<<<<<<< HEAD
953-
text: 'IDE 插件',
954-
=======
955-
text: 'Testing Types',
895+
text: '类型测试',
956896
link: '/guide/testing-types',
957897
},
958898
{
959-
text: 'In-Source Testing',
899+
text: '内联测试',
960900
link: '/guide/in-source',
961901
},
962902
],
@@ -968,40 +908,39 @@ export default ({ mode }: { mode: string }) => {
968908
// page is about the runtime environment of the tests themselves
969909
// (jsdom, node), it still belongs here — that's a workflow choice.
970910
{
971-
text: 'Workflow',
911+
text: '工作流',
972912
collapsed: false,
973913
items: [
974914
{
975-
text: 'CLI',
915+
text: '命令行界面',
976916
link: '/guide/cli',
977917
},
978918
{
979-
text: 'Test Filtering',
919+
text: '测试筛选',
980920
link: '/guide/filtering',
981921
},
982922
{
983-
text: 'Test Projects',
923+
text: '测试项目',
984924
link: '/guide/projects',
985925
},
986926
{
987-
text: 'Test Environment',
927+
text: '测试环境',
988928
link: '/guide/environment',
989929
},
990930
{
991-
text: 'Parallelism',
931+
text: '并行测试',
992932
link: '/guide/parallelism',
993933
},
994934
{
995-
text: 'Reporters',
935+
text: '报告器',
996936
link: '/guide/reporters',
997937
},
998938
{
999-
text: 'Vitest UI',
939+
text: 'UI 模式',
1000940
link: '/guide/ui',
1001941
},
1002942
{
1003-
text: 'IDE Integration',
1004-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
943+
text: 'IDE 插件',
1005944
link: '/guide/ide',
1006945
},
1007946
],
@@ -1013,11 +952,11 @@ export default ({ mode }: { mode: string }) => {
1013952
// measures or fixes the suite (rather than authoring or running
1014953
// it), put it here.
1015954
{
1016-
text: 'Quality & Debugging',
955+
text: '质量与调试',
1017956
collapsed: false,
1018957
items: [
1019958
{
1020-
text: 'Coverage',
959+
text: '覆盖率',
1021960
link: '/guide/coverage',
1022961
},
1023962
{
@@ -1029,30 +968,7 @@ export default ({ mode }: { mode: string }) => {
1029968
link: '/guide/common-errors',
1030969
},
1031970
{
1032-
<<<<<<< HEAD
1033-
text: '迁移指南',
1034-
link: '/guide/migration',
1035-
collapsed: false,
1036-
items: [
1037-
{
1038-
text: '迁移到 Vitest 4',
1039-
link: '/guide/migration#vitest-4',
1040-
},
1041-
{
1042-
text: '从 Jest 迁移',
1043-
link: '/guide/migration#jest',
1044-
},
1045-
{
1046-
text: '从 Mocha + Chai + Sinon 迁移',
1047-
link: '/guide/migration#mocha-chai-sinon',
1048-
},
1049-
],
1050-
},
1051-
{
1052971
text: '性能',
1053-
=======
1054-
text: 'Performance',
1055-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
1056972
collapsed: false,
1057973
items: [
1058974
{
@@ -1078,7 +994,7 @@ export default ({ mode }: { mode: string }) => {
1078994
// comes from composition, or when users would search by intent
1079995
// rather than by API name.
1080996
{
1081-
text: 'Recipes',
997+
text: '技巧',
1082998
collapsed: false,
1083999
items: [
10841000
{
@@ -1154,36 +1070,28 @@ export default ({ mode }: { mode: string }) => {
11541070
// Sits near the bottom because it's not daily-use and would push
11551071
// active-use guides further from the user's first scroll.
11561072
{
1157-
text: 'Migration',
1073+
text: '迁移',
11581074
link: '/guide/migration',
11591075
collapsed: false,
11601076
items: [
11611077
{
1162-
<<<<<<< HEAD
1163-
text: '测试技巧',
1164-
link: '/guide/recipes',
1165-
},
1166-
{
1167-
text: '测试框架比较',
1168-
=======
1169-
text: 'Migrating to Vitest 4.0',
1078+
text: '迁移至 Vitest 4.0',
11701079
link: '/guide/migration#vitest-4',
11711080
},
11721081
{
1173-
text: 'Migrating from Jest',
1082+
text: 'Jest 迁移',
11741083
link: '/guide/migration#jest',
11751084
},
11761085
{
1177-
text: 'Migrating from Mocha + Chai + Sinon',
1086+
text: 'Mocha + Chai + Sinon 迁移',
11781087
link: '/guide/migration#mocha-chai-sinon',
11791088
},
11801089
],
11811090
},
11821091
{
11831092
items: [
11841093
{
1185-
text: 'Comparisons',
1186-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
1094+
text: '测试框架比较',
11871095
link: '/guide/comparisons',
11881096
},
11891097
],

api/advanced/vitest.md

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,8 @@ title: Vitest API
77

88
Vitest 实例需要当前的测试模式。它可以是以下之一:
99

10-
<<<<<<< HEAD
1110
- `test`:运行运行时测试时
12-
- `benchmark`:运行基准测试时 <Badge type="warning">实验性</Badge>
13-
=======
14-
- `test` when running runtime tests
15-
- `benchmark` when running benchmarks <Experimental />
16-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
11+
- `benchmark`:运行基准测试时 <Experimental />
1712

1813
::: details New in Vitest 4
1914
Vitest 4 新增了多个 API(它们都标记有 "4.0.0+" 徽章),并移除了已弃用的 API:
@@ -36,11 +31,7 @@ Vitest 4 新增了多个 API(它们都标记有 "4.0.0+" 徽章),并移除
3631

3732
测试模式只会调用 `test``it` 中的函数,并在遇到 `bench` 时抛出错误。此模式使用配置中的 `include``exclude` 选项来查找测试文件。
3833

39-
<<<<<<< HEAD
40-
### benchmark <Badge type="warning">实验性</Badge> {#benchmark-experimental}
41-
=======
4234
### benchmark <Experimental /> {#benchmark}
43-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
4435

4536
基准测试模式调用 `bench` 函数,并在遇到 `test``it` 时抛出错误。此模式使用配置中的 `benchmark.include``benchmark.exclude` 选项来查找基准测试文件。
4637

@@ -56,11 +47,7 @@ Vitest 4 新增了多个 API(它们都标记有 "4.0.0+" 徽章),并移除
5647

5748
这是全局的 [`ViteDevServer`](https://vite.dev/guide/api-javascript#vitedevserver)
5849

59-
<<<<<<< HEAD
60-
## state <Badge type="warning">实验性</Badge> {#state-experimental}
61-
=======
6250
## state <Experimental /> {#state}
63-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
6451

6552
::: warning
6653
公共 `state` 是一个实验性 API(除了 `vitest.state.getReportedEntity`)。破坏性更改可能不遵循 SemVer,请在使用时固定 Vitest 的版本。

api/browser/assertions.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1003,11 +1003,7 @@ await expect.element(queryByTestId('prev')).not.toHaveSelection()
10031003
await expect.element(queryByTestId('next')).toHaveSelection('ne')
10041004
```
10051005

1006-
<<<<<<< HEAD
1007-
## toMatchScreenshot <Badge type="warning">实验性</Badge> {#tomatchscreenshot}
1008-
=======
10091006
## toMatchScreenshot <Experimental /> {#tomatchscreenshot}
1010-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
10111007

10121008
```ts
10131009
function toMatchScreenshot(

api/vi.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1068,7 +1068,7 @@ function useFakeTimers(config?: FakeTimersConfig): Vitest
10681068
`vi.useFakeTimers()` 不再自动模拟 `process.nextTick`
10691069
仍然可以通过在 `toFake` 参数中指定选项来模拟: `vi.useFakeTimers({ toFake: ['nextTick', 'queueMicrotask'] })`
10701070
:::
1071-
1071+
<!-- TODO: translation -->
10721072
You can use `toFake` to specify which timers to mock, or `toNotFake` to specify which timers to keep native. Note that `toFake` and `toNotFake` cannot be specified together.
10731073

10741074
```ts

config/browser/webdriverio.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,9 @@ export default defineConfig({
6060
::: tip
6161
最有用的选项位于 `capabilities` 对象上。WebdriverIO 允许嵌套功能,但 Vitest 将忽略这些选项,因为我们依赖于不同的机制来生成多个浏览器。
6262

63-
<<<<<<< HEAD
6463
请注意,Vitest 将忽略 `capabilities.browserName` — 请改用 [`test.browser.instances.browser`](/config/browser/instances#browser)
65-
=======
66-
Note that Vitest will ignore `capabilities.browserName`; use [`test.browser.instances.browser`](/config/browser/instances#browser) instead.
67-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
6864
:::
69-
65+
<!-- TODO: translation -->
7066
## Headful Chrome in CI
7167

7268
Vitest enables [`browser.headless`](/config/browser/headless) automatically in CI.

config/faketimers.md

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

66
# fakeTimers
77

8-
<<<<<<< HEAD
9-
- **类型:** `FakeTimerInstallOpts`
10-
=======
11-
- **Type:** `FakeTimerConfig`
12-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
8+
- **类型:** `FakeTimerConfig`
139

1410
当使用 [`vi.useFakeTimers()`](/api/vi#vi-usefaketimers) 时,Vitest 会将此选项传递给 [`@sinon/fake-timers`](https://npmx.dev/package/@sinonjs/fake-timers)
1511

@@ -25,16 +21,10 @@ outline: deep
2521
- **类型:** `('setTimeout' | 'clearTimeout' | 'setImmediate' | 'clearImmediate' | 'setInterval' | 'clearInterval' | 'Date' | 'nextTick' | 'hrtime' | 'requestAnimationFrame' | 'cancelAnimationFrame' | 'requestIdleCallback' | 'cancelIdleCallback' | 'performance' | 'queueMicrotask')[]`
2622
- **默认值:** 全局可用的所有方法,除了 `nextTick``queueMicrotask`
2723

28-
<<<<<<< HEAD
29-
需要模拟的全局方法和 API 名称数组。
30-
31-
如果仅需模拟 `setTimeout()``nextTick()`,可将此属性指定为 `['setTimeout', 'nextTick']`
32-
=======
33-
An array with names of global methods and APIs to fake. For example, to only mock `setTimeout()` and `nextTick()`, specify this property as `['setTimeout', 'nextTick']`.
34-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
24+
需要模拟的全局方法和 API 名称数组。例如仅需模拟 `setTimeout()``nextTick()`,可将此属性指定为 `['setTimeout', 'nextTick']`
3525

3626
当使用 `--pool=forks``node:child_process` 中运行 Vitest 时,不支持模拟 `nextTick`。NodeJS 会在 `node:child_process` 内部使用 `process.nextTick`,模拟后会导致进程挂起。使用 `--pool=threads` 运行 Vitest 时支持模拟 `nextTick`
37-
27+
<!-- TODO: translation -->
3828
## fakeTimers.toNotFake
3929

4030
- **Type:** `('setTimeout' | 'clearTimeout' | 'setImmediate' | 'clearImmediate' | 'setInterval' | 'clearInterval' | 'Date' | 'nextTick' | 'hrtime' | 'requestAnimationFrame' | 'cancelAnimationFrame' | 'requestIdleCallback' | 'cancelIdleCallback' | 'performance' | 'queueMicrotask')[]`

guide/browser/aria-snapshots.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ title: ARIA 快照 | 指南
33
outline: deep
44
---
55

6-
<<<<<<< HEAD
7-
# ARIA 快照 <Experimental/> <Version>4.1.4</Version> {#aria-snapshots}
8-
=======
9-
# ARIA Snapshots <Experimental /> <Version>4.1.4</Version> {#aria-snapshots}
10-
>>>>>>> 3a513123224c0041b8cda52ce1f47c912ce05789
6+
# ARIA 快照 <Experimental /> <Version>4.1.4</Version> {#aria-snapshots}
117

128
ARIA 快照可以让你测试页面的无障碍结构。你不是去断言原始 HTML 或视觉输出,而是去断言无障碍树,也就是屏幕阅读器和其他辅助技术所使用的那套结构。
139

0 commit comments

Comments
 (0)