-
-
Notifications
You must be signed in to change notification settings - Fork 111
docs(en): merge docs-cn/sync-docs into docs-cn/dev @ 2aae193f #962
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
base: dev
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -100,7 +100,7 @@ export default defineConfig({ | |
| 默认情况下(即如果没有指定报告器),Vitest 会在底部显示运行测试的摘要及其状态。一旦测试套件通过,其状态将被报告在摘要的顶部。 | ||
| <!-- TODO: translation --> | ||
| ::: tip | ||
| When Vitest detects it is running inside an AI coding agent, the [`agent`](#agent-reporter) reporter is used instead to reduce output and minimize token usage. You can override this by explicitly configuring the [`reporters`](/config/reporters) option. | ||
| When Vitest detects it is running inside an AI coding agent, the [`minimal`](#minimal-reporter) reporter is used instead to reduce output and minimize token usage. You can override this by explicitly configuring the [`reporters`](/config/reporters) option. | ||
| ::: | ||
|
|
||
| 我们可以通过配置报告器来禁用摘要: | ||
|
|
@@ -670,21 +670,24 @@ export default defineConfig({ | |
| }) | ||
| ``` | ||
|
|
||
| ### Agent Reporter | ||
| ### Minimal Reporter | ||
|
|
||
| Outputs a minimal report optimized for AI coding assistants and LLM-based workflows. Only failed tests and their error messages are displayed. Console logs from passing tests and the summary section are suppressed to reduce token usage. | ||
| - **Alias:** `agent` | ||
|
|
||
| This reporter is automatically enabled when no `reporters` option is configured and Vitest detects it is running inside an AI coding agent. If you configure custom reporters, you can explicitly add `agent`: | ||
| Outputs a minimal report containing only failed tests and their error messages. Console logs from passing tests and the summary section are also suppressed. | ||
|
|
||
| ::: tip Agent Reporter | ||
| This reporter is well optimized for AI coding assistants and LLM-based workflows to reduce token usage. It is automatically enabled when no `reporters` option is configured and Vitest detects it is running inside an AI coding agent. If you configure custom reporters, you can explicitly add `minimal` or `agent`: | ||
|
|
||
| :::code-group | ||
|
Comment on lines
+679
to
682
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
A new Useful? React with 👍 / 👎. |
||
| ```bash [CLI] | ||
| npx vitest --reporter=agent | ||
| npx vitest --reporter=minimal | ||
| ``` | ||
|
|
||
| ```ts [vitest.config.ts] | ||
| export default defineConfig({ | ||
| test: { | ||
| reporters: ['agent'] | ||
| reporters: ['minimal'] | ||
| }, | ||
| }) | ||
| ``` | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section still contains Git conflict markers (
<<<<<<<,=======,>>>>>>>), which means the merge was left unresolved. As committed, the generated CLI docs will render raw conflict text (and many docs pipelines treat this as a hard failure), so users cannot reliably read the--reporterdescription until this block is resolved to a single final sentence.Useful? React with 👍 / 👎.