| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -42,7 +42,7 @@ Note that the [coverage](/guide/coverage) feature uses a different [`coverage.re | |||
| 42 | 42 | - [`tap-flat`](/guide/reporters#tap-flat-reporter) | |
| 43 | 43 | - [`hanging-process`](/guide/reporters#hanging-process-reporter) | |
| 44 | 44 | - [`github-actions`](/guide/reporters#github-actions-reporter) | |
| 45 | - - [`agent`](/guide/reporters#agent-reporter) | ||
| 45 | + - [`minimal`](/guide/reporters#minimal-reporter) (aliased as `agent`) | ||
| 46 | 46 | - [`blob`](/guide/reporters#blob-reporter) | |
| 47 | 47 | ||
| 48 | 48 | ## Example | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -102,7 +102,7 @@ Hide logs for skipped tests | |||
| 102 | 102 | - **CLI:** `--reporter <name>` | |
| 103 | 103 | - **Config:** [reporters](/config/reporters) | |
| 104 | 104 | ||
| 105 | - Specify reporters (default, agent, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions) | ||
| 105 | + Specify reporters (default, agent, minimal, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions) | ||
| 106 | 106 | ||
| 107 | 107 | ### outputFile | |
| 108 | 108 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -99,7 +99,7 @@ This example will write separate JSON and XML reports as well as printing a verb | |||
| 99 | 99 | By default (i.e. if no reporter is specified), Vitest will display summary of running tests and their status at the bottom. Once a suite passes, its status will be reported on top of the summary. | |
| 100 | 100 | ||
| 101 | 101 | ::: tip | |
| 102 | - 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. | ||
| 102 | + 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. | ||
| 103 | 103 | ::: | |
| 104 | 104 | ||
| 105 | 105 | You can disable the summary by configuring the reporter: | |
@@ -655,21 +655,24 @@ export default defineConfig({ | |||
| 655 | 655 | }) | |
| 656 | 656 | ``` | |
| 657 | 657 | ||
| 658 | - ### Agent Reporter | ||
| 658 | + ### Minimal Reporter | ||
| 659 | 659 | ||
| 660 | - 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. | ||
| 660 | + - **Alias:** `agent` | ||
| 661 | 661 | ||
| 662 | - 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`: | ||
| 662 | + Outputs a minimal report containing only failed tests and their error messages. Console logs from passing tests and the summary section are also suppressed. | ||
| 663 | + | ||
| 664 | + ::: tip Agent Reporter | ||
| 665 | + 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`: | ||
| 663 | 666 | ||
| 664 | 667 | :::code-group | |
| 665 | 668 | ```bash [CLI] | |
| 666 | - npx vitest --reporter=agent | ||
| 669 | + npx vitest --reporter=minimal | ||
| 667 | 670 | ``` | |
| 668 | 671 | ||
| 669 | 672 | ```ts [vitest.config.ts] | |
| 670 | 673 | export default defineConfig({ | |
| 671 | 674 | test: { | |
| 672 | - reporters: ['agent'] | ||
| 675 | + reporters: ['minimal'] | ||
| 673 | 676 | }, | |
| 674 | 677 | }) | |
| 675 | 678 | ``` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -140,7 +140,7 @@ export const cliOptionsConfig: VitestCLIOptions = { | |||
| 140 | 140 | }, | |
| 141 | 141 | reporters: { | |
| 142 | 142 | alias: 'reporter', | |
| 143 | - description: `Specify reporters (default, agent, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)`, | ||
| 143 | + description: `Specify reporters (default, agent, minimal, blob, verbose, dot, json, tap, tap-flat, junit, tree, hanging-process, github-actions)`, | ||
| 144 | 144 | argument: '<name>', | |
| 145 | 145 | subcommands: null, // don't support custom objects | |
| 146 | 146 | array: true, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,14 +6,14 @@ import type { GithubActionsReporterOptions } from './github-actions' | |||
| 6 | 6 | import type { HTMLOptions } from './html' | |
| 7 | 7 | import type { JsonOptions } from './json' | |
| 8 | 8 | import type { JUnitOptions } from './junit' | |
| 9 | - import { AgentReporter } from './agent' | ||
| 10 | 9 | import { BlobReporter } from './blob' | |
| 11 | 10 | import { DefaultReporter } from './default' | |
| 12 | 11 | import { DotReporter } from './dot' | |
| 13 | 12 | import { GithubActionsReporter } from './github-actions' | |
| 14 | 13 | import { HangingProcessReporter } from './hanging-process' | |
| 15 | 14 | import { JsonReporter } from './json' | |
| 16 | 15 | import { JUnitReporter } from './junit' | |
| 16 | + import { AgentReporter } from './minimal' | ||
| 17 | 17 | import { TapReporter } from './tap' | |
| 18 | 18 | import { TapFlatReporter } from './tap-flat' | |
| 19 | 19 | import { TreeReporter } from './tree' | |
@@ -27,6 +27,7 @@ export { | |||
| 27 | 27 | HangingProcessReporter, | |
| 28 | 28 | JsonReporter, | |
| 29 | 29 | JUnitReporter, | |
| 30 | + AgentReporter as MinimalReporter, | ||
| 30 | 31 | TapFlatReporter, | |
| 31 | 32 | TapReporter, | |
| 32 | 33 | TreeReporter, | |
@@ -49,6 +50,7 @@ export type { | |||
| 49 | 50 | export const ReportersMap = { | |
| 50 | 51 | 'default': DefaultReporter as typeof DefaultReporter, | |
| 51 | 52 | 'agent': AgentReporter as typeof AgentReporter, | |
| 53 | + 'minimal': AgentReporter as typeof AgentReporter, | ||
| 52 | 54 | 'blob': BlobReporter as typeof BlobReporter, | |
| 53 | 55 | 'verbose': VerboseReporter as typeof VerboseReporter, | |
| 54 | 56 | 'dot': DotReporter as typeof DotReporter, | |
@@ -65,6 +67,7 @@ export type BuiltinReporters = keyof typeof ReportersMap | |||
| 65 | 67 | ||
| 66 | 68 | export interface BuiltinReporterOptions { | |
| 67 | 69 | 'default': DefaultReporterOptions | |
| 70 | + 'minimal': DefaultReporterOptions | ||
| 68 | 71 | 'agent': DefaultReporterOptions | |
| 69 | 72 | 'verbose': DefaultReporterOptions | |
| 70 | 73 | 'dot': BaseOptions | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3,7 +3,7 @@ import type { DefaultReporterOptions } from './default' | |||
| 3 | 3 | import type { TestCase, TestModule, TestModuleState } from './reported-tasks' | |
| 4 | 4 | import { DefaultReporter } from './default' | |
| 5 | 5 | ||
| 6 | - export class AgentReporter extends DefaultReporter { | ||
| 6 | + export class MinimalReporter extends DefaultReporter { | ||
| 7 | 7 | renderSucceed = false | |
| 8 | 8 | ||
| 9 | 9 | constructor(options: DefaultReporterOptions = {}) { | |
@@ -29,3 +29,5 @@ export class AgentReporter extends DefaultReporter { | |||
| 29 | 29 | } | |
| 30 | 30 | } | |
| 31 | 31 | } | |
| 32 | + | ||
| 33 | + export { MinimalReporter as AgentReporter } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -52,6 +52,7 @@ export { | |||
| 52 | 52 | HangingProcessReporter, | |
| 53 | 53 | JsonReporter, | |
| 54 | 54 | JUnitReporter, | |
| 55 | + MinimalReporter, | ||
| 55 | 56 | ReportersMap, | |
| 56 | 57 | TapFlatReporter, | |
| 57 | 58 | TapReporter, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ export { | |||
| 8 | 8 | HangingProcessReporter, | |
| 9 | 9 | JsonReporter, | |
| 10 | 10 | JUnitReporter, | |
| 11 | + MinimalReporter, | ||
| 11 | 12 | ReportersMap, | |
| 12 | 13 | TapFlatReporter, | |
| 13 | 14 | TapReporter, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -100,6 +100,7 @@ it('exports snapshot', async ({ skip, task }) => { | |||
| 100 | 100 | "HangingProcessReporter": "function", | |
| 101 | 101 | "JUnitReporter": "function", | |
| 102 | 102 | "JsonReporter": "function", | |
| 103 | + "MinimalReporter": "function", | ||
| 103 | 104 | "ReportersMap": "object", | |
| 104 | 105 | "TapFlatReporter": "function", | |
| 105 | 106 | "TapReporter": "function", | |
@@ -151,6 +152,7 @@ it('exports snapshot', async ({ skip, task }) => { | |||
| 151 | 152 | "HangingProcessReporter": "function", | |
| 152 | 153 | "JUnitReporter": "function", | |
| 153 | 154 | "JsonReporter": "function", | |
| 155 | + "MinimalReporter": "function", | ||
| 154 | 156 | "ReportersMap": "object", | |
| 155 | 157 | "TapFlatReporter": "function", | |
| 156 | 158 | "TapReporter": "function", | |
| Back | FazBrowse Home | New Git URL |
0 commit comments