Skip to content

Commit fc48485

Browse files
authored
feat(coverage): default to text reporter skipFull if agent detected (#10018)
1 parent 3af71f2 commit fc48485

2 files changed

Lines changed: 13 additions & 0 deletions

File tree

config/coverage.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,10 @@ You can also pass custom coverage reporters. See [Guide - Custom Coverage Report
133133

134134
You can check your coverage report in Vitest UI: check [Vitest UI Coverage](/guide/coverage#vitest-ui) for more details.
135135

136+
::: tip AI coding agents
137+
When Vitest detects it is running inside an AI coding agent, it automatically adds the `text-summary` reporter and sets `skipFull: true` on the `text` reporter to reduce output and minimize token usage.
138+
:::
139+
136140
## coverage.reportOnFailure {#coverage-reportonfailure}
137141

138142
- **Type:** `boolean`

guide/coverage.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,3 +508,12 @@ This is integrated with builtin coverage reporters with HTML output (`html`, `ht
508508

509509
<img alt="html coverage in Vitest UI" img-light src="/ui-coverage-1-light.png">
510510
<img alt="html coverage in Vitest UI" img-dark src="/ui-coverage-1-dark.png">
511+
512+
## Coverage in Agent Environments
513+
514+
When Vitest detects it is running inside an AI coding agent, it automatically adjusts the default `text` reporter to reduce output and minimize token usage:
515+
516+
- `skipFull: true` is set on the `text` reporter, so files with 100% coverage are omitted from the terminal output.
517+
- The [`text-summary`](/config/coverage#coverage-reporter) reporter is added automatically, so the agent always sees a concise totals table even when `skipFull` hides all individual files.
518+
519+
These adjustments only apply when the `text` reporter is already part of the active reporter list (it is included in the default). Explicitly configured reporters are never removed.

0 commit comments

Comments
 (0)