Skip to content

Commit 1983aa9

Browse files
authored
docs: fix Vitest migration table formatting (#1295)
1 parent 67c8e13 commit 1983aa9

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

website/docs/en/guide/migration/vitest.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ When migrating config, keep two changes in mind:
9292
Walk through **every** option under `test` and match it against the table below — move it to the top level, rename it, or drop it. Fields not listed here may not map 1:1; verify against the [Rstest config reference](/config) before dropping them silently.
9393

9494
| Vitest (under `test`) | Rstest (top-level) | Notes |
95-
| ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------- |
95+
| ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
9696
| `environment` | [`testEnvironment`](/config/test/test-environment) | Fold `test.environmentOptions` into the object form: `testEnvironment: { name: 'jsdom', options: { ... } }`. Custom environment packages are not supported. |
9797
| `include` / `exclude` | [`include`](/config/test/include) / [`exclude`](/config/test/exclude) | |
9898
| `includeSource` | [`includeSource`](/config/test/include-source) | |
@@ -125,7 +125,7 @@ Walk through **every** option under `test` and match it against the table below
125125
| `logHeapUsage` | [`logHeapUsage`](/config/test/log-heap-usage) | |
126126
| `detectAsyncLeaks` | [`detectAsyncLeaks`](/config/test/detect-async-leaks) | Use while debugging leaked async resources. Rstest reports active Node.js async resources after a test file finishes. |
127127
| `includeTaskLocation` | [`includeTaskLocation`](/config/test/include-task-location) | |
128-
| `silent` | [`silent`](/config/test/silent) | Matches Vitest's `boolean | 'passed-only'` semantics for intercepted test console output. |
128+
| `silent` | [`silent`](/config/test/silent) | Matches Vitest's `boolean \| 'passed-only'` semantics for intercepted test console output. |
129129
| `printConsoleTrace` | [`printConsoleTrace`](/config/test/print-console-trace) | |
130130
| `unstubGlobals` | [`unstubGlobals`](/config/test/unstub-globals) | |
131131
| `unstubEnvs` | [`unstubEnvs`](/config/test/unstub-envs) | |

website/docs/zh/guide/migration/vitest.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ Vitest 配置文件中使用的 helper 可以对应到 `@rstest/core` 导出的
9292
请遍历 `test` 下的**每一个**字段,对照下表进行提升、重命名或删除。表中未列出的字段未必能 1:1 映射,直接删除前请先对照 [Rstest 配置参考](/config) 确认。
9393

9494
| Vitest(`test` 下) | Rstest(顶层) | 说明 |
95-
| ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- |
95+
| ----------------------------- | ---------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
9696
| `environment` | [`testEnvironment`](/config/test/test-environment) |`test.environmentOptions` 合并到对象形式:`testEnvironment: { name: 'jsdom', options: { ... } }`。不支持自定义 environment 包。 |
9797
| `include` / `exclude` | [`include`](/config/test/include) / [`exclude`](/config/test/exclude) | |
9898
| `includeSource` | [`includeSource`](/config/test/include-source) | |
@@ -125,7 +125,7 @@ Vitest 配置文件中使用的 helper 可以对应到 `@rstest/core` 导出的
125125
| `logHeapUsage` | [`logHeapUsage`](/config/test/log-heap-usage) | |
126126
| `detectAsyncLeaks` | [`detectAsyncLeaks`](/config/test/detect-async-leaks) | 用于排查异步资源泄漏。Rstest 会在测试文件结束后报告仍然存活的 Node.js 异步资源。 |
127127
| `includeTaskLocation` | [`includeTaskLocation`](/config/test/include-task-location) | |
128-
| `silent` | [`silent`](/config/test/silent) | 与 Vitest 一样支持 `boolean | 'passed-only'`,用于控制被拦截的测试 console 输出。 |
128+
| `silent` | [`silent`](/config/test/silent) | 与 Vitest 一样支持 `boolean \| 'passed-only'`,用于控制被拦截的测试 console 输出。 |
129129
| `printConsoleTrace` | [`printConsoleTrace`](/config/test/print-console-trace) | |
130130
| `unstubGlobals` | [`unstubGlobals`](/config/test/unstub-globals) | |
131131
| `unstubEnvs` | [`unstubEnvs`](/config/test/unstub-envs) | |

0 commit comments

Comments
 (0)