Skip to content

docs(en): merge docs-cn/sync-docs into docs-cn/dev @ 9ec1afbe #591

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion guide/browser/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ export interface BrowserScript {
- **Default:** `[]`

::: danger
This API is deprecated an will be removed in Vitest 4. Please, use [`browser.testerHtmlPath`](#browser-testerHtmlPath) field instead.
This API is deprecated an will be removed in Vitest 4. Please, use [`browser.testerHtmlPath`](#browser-testerhtmlpath) field instead.
:::

Custom scripts that should be injected into the tester HTML before the tests environment is initiated. This is useful to inject polyfills required for Vitest browser implementation. It is recommended to use [`setupFiles`](#setupfiles) in almost all cases instead of this.
Expand Down
4 changes: 4 additions & 0 deletions guide/browser/locators.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ outline: [2, 3]

定位器是元素或多个元素的表示。每个定位器由一个称为选择器的字符串定义。Vitest 通过提供方便的方法在后台生成这些选择器,从而抽象了选择器。

<<<<<<< HEAD
定位器 API 使用了 [Playwright 定位器](https://playwright.dev/docs/api/class-locator)的一个分支,称为 [Ivya](https://npmjs.com/ivya)。然而,Vitest 将此 API 提供给每一个 [provider](/guide/browser/#provider-configuration)。
=======
The locator API uses a fork of [Playwright's locators](https://playwright.dev/docs/api/class-locator) called [Ivya](https://npmjs.com/ivya). However, Vitest provides this API to every [provider](/guide/browser/config.html#browser-provider).
>>>>>>> 9ec1afbefb2413ce2ea01ddd41c89a571670d913

## getByRole

Expand Down
1 change: 1 addition & 0 deletions guide/mocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ Vitest 支持模拟 Vite [虚拟模块](https://cn.vitejs.dev/guide/api-plugin#v

```ts [vitest.config.js]
import { defineConfig } from 'vitest/config'
import { resolve } from 'node:path'
export default defineConfig({
test: {
alias: {
Expand Down
4 changes: 4 additions & 0 deletions guide/ui.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ vitest --ui

最后,你可以访问 Vitest UI 界面,通过 <a href="http://localhost:51204/__vitest__/">`http://localhost:51204/__vitest__/`</a>

::: warning
The UI is interactive and requires a running Vite server, so make sure to run Vitest in `watch` mode (the default). Alternatively, you can generate a static HTML report that looks identical to the Vitest UI by specifying `html` in config's `reporters` option.
:::

<img alt="Vitest UI" img-light src="/ui-1-light.png">
<img alt="Vitest UI" img-dark src="/ui-1-dark.png">

Expand Down