You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://vitest.new) (you can also use [examples](https://github.com/vitest-dev/vitest/tree/main/examples)). Issues marked with `needs reproduction` will be closed if they have no activity within 3 days.
Hello @${{ github.event.issue.user.login }}. Your content has been labeled `maybe automated` because it appears to have been fully generated by AI with no human involvement. It will be **closed automatically in 3 days** unless a real person responds.
35
+
Hello @${{ github.event.issue.user.login }}. Your issue has been labeled `maybe automated` because it appears to have been fully generated by AI with no human involvement. It will be **closed automatically in 3 days** unless a real person responds.
36
+
37
+
If you're a real person behind this contribution, please:
38
+
- Confirm you've personally reviewed and stand behind its content
39
+
- Make sure it follows our [contribution guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md) and uses the correct [GitHub template](https://github.com/vitest-dev/vitest/blob/main/.github/ISSUE_TEMPLATE/bug_report.yml)
40
+
- Disclose any AI tools you used (e.g. Claude, Copilot, Codex)
41
+
42
+
If you believe this was flagged by mistake, leave a comment.
43
+
44
+
*These measures help us reduce maintenance burden and keep the team's work efficient. See our [AI contributions policy](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md#ai-contributions) for more context.*
Hello @${{ github.event.pull_request.user.login }}. Your PR has been labeled `maybe automated` because it appears to have been fully generated by AI with no human involvement. It will be **closed automatically in 3 days** unless a real person responds.
33
54
34
55
If you're a real person behind this contribution, please:
35
56
- Confirm you've personally reviewed and stand behind its content
36
-
- Make sure it follows our [contribution guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md) and uses the correct GitHub template ([PR](https://github.com/vitest-dev/vitest/blob/main/.github/PULL_REQUEST_TEMPLATE.md), [issue](https://github.com/vitest-dev/vitest/blob/main/.github/ISSUE_TEMPLATE/bug_report.yml))
57
+
- Make sure it follows our [contribution guidelines](https://github.com/vitest-dev/vitest/blob/main/CONTRIBUTING.md) and uses the correct [GitHub template](https://github.com/vitest-dev/vitest/blob/main/.github/PULL_REQUEST_TEMPLATE.md)
37
58
- Disclose any AI tools you used (e.g. Claude, Copilot, Codex)
38
59
39
60
If you believe this was flagged by mistake, leave a comment.
Copy file name to clipboardExpand all lines: AGENTS.md
+10Lines changed: 10 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -158,3 +158,13 @@ If you need to typecheck tests, run `pnpm typecheck` from the root of the worksp
158
158
- Check existing issues and documentation
159
159
- Review CONTRIBUTING.md for detailed guidelines
160
160
- Follow patterns in existing code
161
+
162
+
## PR Descriptions
163
+
164
+
When creating a pull request, you MUST include the following HTML comment at the bottom of the PR description:
165
+
166
+
```
167
+
<!-- VITEST_AUTOMATED_PR -->
168
+
```
169
+
170
+
This allows maintainers to identify AI-assisted PRs for triage. PRs containing this marker will be automatically labeled `maybe automated` and will be closed in 3 days unless a real person confirms ownership.
Copy file name to clipboardExpand all lines: docs/api/browser/context.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -292,7 +292,7 @@ utils.configurePrettyDOM({
292
292
- **`maxLength`** - Maximum length of the output string (default: `7000`)
293
293
- **`filterNode`** - A CSS selector string or function to filter out nodes from the output. When a string is provided, elements matching the selector will be excluded. When a function is provided, it should return `false` to exclude a node.
- And other options from [`pretty-format`](https://npmx.dev/package/@vitest/pretty-format)
295
+
- And other options from [`@vitest/pretty-format`](https://npmx.dev/package/@vitest/pretty-format)
296
296
297
297
#### Filtering with CSS Selectors <Version>4.1.0</Version> {#filtering-with-css-selectors}
Copy file name to clipboardExpand all lines: docs/config/coverage.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,10 @@ You can also pass custom coverage reporters. See [Guide - Custom Coverage Report
133
133
134
134
You can check your coverage report in Vitest UI: check [Vitest UI Coverage](/guide/coverage#vitest-ui) for more details.
135
135
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.
Copy file name to clipboardExpand all lines: docs/config/diff.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,6 +10,8 @@ outline: deep
10
10
11
11
`DiffOptions` object or a path to a module which exports `DiffOptions`. Useful if you want to customize diff display.
12
12
13
+
Vitest diff rendering uses [`@vitest/pretty-format`](https://npmx.dev/package/@vitest/pretty-format) under the hood and a part of `DiffOptions` is forwarded to the pretty-format configuration, while the rest affects diff rendering itself.
Copy file name to clipboardExpand all lines: docs/config/experimental.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -479,3 +479,36 @@ export default {
479
479
If module runner is disabled, Vitest uses a native [Node.js module loader](https://nodejs.org/api/module.html#customization-hooks) to transform files to support `import.meta.vitest`, `vi.mock` and `vi.hoisted`.
480
480
481
481
If you don't use these features, you can disable this to improve performance.
Parses test specifications before running them. This applies the [`.only`](/api/test#test-only) modifier, the [`-t`](/config/testnamepattern) test name pattern, [`--tags-filter`](/guide/test-tags#syntax), [test lines](/api/advanced/test-specification#testlines), and [test IDs](/api/advanced/test-specification#testids) across all files without executing them. For example, if only a single test is marked with `.only`, Vitest will skip all other tests in all files.
489
+
490
+
::: tip
491
+
This option is recommended when using [`.only`](/api/test#test-only), the [`-t`](/config/testnamepattern) flag, or [`--tags-filter`](/guide/test-tags#syntax).
492
+
493
+
Enabling it unconditionally may slow down your test runs due to the additional parsing step.
494
+
:::
495
+
496
+
::: warning
497
+
Pre-parsing uses static analysis (AST parsing) instead of executing your test files. This means that test names, tags, and modifiers (`.only`, `.skip`, `.todo`) must be statically analyzable. Dynamic test names (e.g., names stored in variables or returned from function calls) and non-literal tags will not be resolved correctly.
Format options for snapshot testing. These options are passed down to our fork of [`pretty-format`](https://npmx.dev/package/pretty-format). In addition to the `pretty-format` options we support `printShadowRoot: boolean`.
10
+
Format options for snapshot testing. These options configure the snapshot-specific formatting layer built on top of [`@vitest/pretty-format`](https://npmx.dev/package/@vitest/pretty-format).
11
+
12
+
For the full option surface of `PrettyFormatOptions`, see [`@vitest/pretty-format`](https://npmx.dev/package/@vitest/pretty-format). This page focuses on the Vitest snapshot-specific defaults and constraints.
13
+
14
+
Vitest snapshots already apply these defaults before your `snapshotFormat` overrides:
15
+
16
+
-`printBasicPrototype: false`
17
+
-`escapeString: false`
18
+
-`escapeRegex: true`
19
+
-`printFunctionName: false`
20
+
21
+
Vitest also supports formatter options such as `printShadowRoot` and `maxOutputLength` in `snapshotFormat`.
22
+
23
+
`printShadowRoot` controls whether shadow-root contents are included in DOM snapshots.
24
+
25
+
`maxOutputLength` is an approximate per-depth output budget, not a hard cap on the final rendered string.
26
+
27
+
By default, snapshot keys are sorted using the formatter's default behavior. Set `compareKeys` to `null` to disable key sorting. Custom compare functions are not supported in `snapshotFormat`.
11
28
12
29
::: tip
13
-
Beware that `plugins`field on this object will be ignored.
30
+
Beware that `plugins` on this object will be ignored.
14
31
15
-
If you need to extend snapshot serializer via pretty-format plugins, please, use [`expect.addSnapshotSerializer`](/api/expect#expect-addsnapshotserializer)API or [snapshotSerializers](/config/snapshotserializers)option.
32
+
If you need to extend snapshot serialization via pretty-format plugins, use [`expect.addSnapshotSerializer`](/api/expect#expect-addsnapshotserializer) or [`snapshotSerializers`](/config/snapshotserializers)instead.
Parse test specifications before running them. This will apply `.only` flag and test name pattern across all files without running them. (default: `false`)
0 commit comments