[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

fix: alias `agent` reporter to `minimal` (#10157)

authored by

Vladimir and committed by
GitHub
(Apr 20, 2026, 9:34 AM +0200) 663b99fe 122c25b5

+53 -41
+1 -1
docs/config/reporters.md
··· 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
+1 -1
docs/guide/cli-generated.md
··· 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
+9 -6
docs/guide/reporters.md
··· 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 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 ```
+2
test/core/test/exports.test.ts
··· 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 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",
+1
packages/vitest/src/public/node.ts
··· 52 52 HangingProcessReporter, 53 53 JsonReporter, 54 54 JUnitReporter, 55 + MinimalReporter, 55 56 ReportersMap, 56 57 TapFlatReporter, 57 58 TapReporter,
+1
packages/vitest/src/public/reporters.ts
··· 8 8 HangingProcessReporter, 9 9 JsonReporter, 10 10 JUnitReporter, 11 + MinimalReporter, 11 12 ReportersMap, 12 13 TapFlatReporter, 13 14 TapReporter,
+1 -1
packages/vitest/src/node/cli/cli-config.ts
··· 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,
-31
packages/vitest/src/node/reporters/agent.ts
··· 1 - import type { TestSpecification } from '../test-specification' 2 - import type { DefaultReporterOptions } from './default' 3 - import type { TestCase, TestModule, TestModuleState } from './reported-tasks' 4 - import { DefaultReporter } from './default' 5 - 6 - export class AgentReporter extends DefaultReporter { 7 - renderSucceed = false 8 - 9 - constructor(options: DefaultReporterOptions = {}) { 10 - super({ silent: 'passed-only', ...options, summary: false }) 11 - } 12 - 13 - onTestRunStart(specifications: ReadonlyArray<TestSpecification>): void { 14 - super.onTestRunStart(specifications) 15 - this.renderSucceed = false 16 - } 17 - 18 - protected printTestModule(testModule: TestModule): void { 19 - if (testModule.state() !== 'failed') { 20 - return 21 - } 22 - super.printTestModule(testModule) 23 - } 24 - 25 - protected printTestCase(moduleState: TestModuleState, test: TestCase): void { 26 - const testResult = test.result() 27 - if (testResult.state === 'failed') { 28 - super.printTestCase(moduleState, test) 29 - } 30 - } 31 - }
+4 -1
packages/vitest/src/node/reporters/index.ts
··· 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' ··· 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 27 HangingProcessReporter, 28 28 JsonReporter, 29 29 JUnitReporter, 30 + AgentReporter as MinimalReporter, 30 31 TapFlatReporter, 31 32 TapReporter, 32 33 TreeReporter, ··· 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 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
+33
packages/vitest/src/node/reporters/minimal.ts
··· 1 + import type { TestSpecification } from '../test-specification' 2 + import type { DefaultReporterOptions } from './default' 3 + import type { TestCase, TestModule, TestModuleState } from './reported-tasks' 4 + import { DefaultReporter } from './default' 5 + 6 + export class MinimalReporter extends DefaultReporter { 7 + renderSucceed = false 8 + 9 + constructor(options: DefaultReporterOptions = {}) { 10 + super({ silent: 'passed-only', ...options, summary: false }) 11 + } 12 + 13 + onTestRunStart(specifications: ReadonlyArray<TestSpecification>): void { 14 + super.onTestRunStart(specifications) 15 + this.renderSucceed = false 16 + } 17 + 18 + protected printTestModule(testModule: TestModule): void { 19 + if (testModule.state() !== 'failed') { 20 + return 21 + } 22 + super.printTestModule(testModule) 23 + } 24 + 25 + protected printTestCase(moduleState: TestModuleState, test: TestCase): void { 26 + const testResult = test.result() 27 + if (testResult.state === 'failed') { 28 + super.printTestCase(moduleState, test) 29 + } 30 + } 31 + } 32 + 33 + export { MinimalReporter as AgentReporter }