Skip to content

feat: expose default reporters through configDefaults.reporters #10219

Merged
sheremet-va merged 12 commits intovitest-dev:mainfrom
hi-ogawa:feat-add-configdefaults-reporters
Apr 28, 2026
Merged

feat: expose default reporters through configDefaults.reporters #10219
sheremet-va merged 12 commits intovitest-dev:mainfrom
hi-ogawa:feat-add-configdefaults-reporters

Conversation

@hi-ogawa
Copy link
Copy Markdown
Collaborator

@hi-ogawa hi-ogawa commented Apr 28, 2026

Description

This PR exposes Vitest’s environment-aware default reporter list through configDefaults.reporters, so users can add their own reporters without losing "good defaults" that Vitest normally applies automatically, such as the minimal/agent reporter in AI-agent environments or github-actions on GitHub Actions, for example:

import { configDefaults, defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    reporters: ['html', ...configDefaults.reporters],
  },
})

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.
  • Please check Allow edits by maintainers to make review process faster. Note that this option is not available for repositories that are owned by Github organizations.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

@netlify
Copy link
Copy Markdown

netlify Bot commented Apr 28, 2026

Deploy Preview for vitest-dev ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d72622f
🔍 Latest deploy log https://app.netlify.com/projects/vitest-dev/deploys/69f069abe751c100084f541a
😎 Deploy Preview https://deploy-preview-10219--vitest-dev.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Comment thread packages/vitest/src/defaults.ts Outdated
@hi-ogawa hi-ogawa requested a review from Copilot April 28, 2026 07:47
Comment thread docs/guide/reporters.md Outdated
})
```

## Default Reporters
Copy link
Copy Markdown
Collaborator Author

@hi-ogawa hi-ogawa Apr 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We now have two sections ## Default Reporters and ### Default Reporter. Ridiculous but not sure what to do 🙃

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I picked ## Default configuration suggested by Claude.

hi-ogawa and others added 2 commits April 28, 2026 17:00
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hi-ogawa hi-ogawa marked this pull request as ready for review April 28, 2026 08:15
@sheremet-va sheremet-va merged commit 083f6bd into vitest-dev:main Apr 28, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support agent detection with configured reporters

2 participants