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
The naming of properties in `playwright` factory now also aligns with [Playwright documentation](https://playwright.dev/docs/api/class-testoptions#test-options-launch-options) making it easier to find.
262
248
249
+
### Reporter Updates
250
+
251
+
Reporter APIs `onCollected`, `onSpecsCollected`, `onPathsCollected`, `onTaskUpdate` and `onFinished` were removed. See [`Reporters API`](/advanced/api/reporters) for new alternatives. The new APIs were introduced in Vitest `v3.0.0`.
252
+
253
+
The `basic` reporter was removed as it is equal to:
254
+
255
+
```ts
256
+
exportdefaultdefineConfig({
257
+
test: {
258
+
reporters: [
259
+
['default', { summary: false }]
260
+
]
261
+
}
262
+
})
263
+
```
264
+
265
+
The [`verbose`](/guide/reporters#verbose-reporter) reporter now prints test cases as a flat list. To revert to the previous behaviour, use `--reporter=tree`:
266
+
267
+
```ts
268
+
exportdefaultdefineConfig({
269
+
test: {
270
+
reporters: ['verbose'], // [!code --]
271
+
reporters: ['tree'], // [!code ++]
272
+
}
273
+
})
274
+
```
275
+
263
276
### Deprecated APIs are Removed
264
277
265
278
Vitest 4.0 removes some deprecated APIs, including:
266
279
267
280
-`poolMatchGlobs` config option. Use [`projects`](/guide/projects) instead.
268
281
-`environmentMatchGlobs` config option. Use [`projects`](/guide/projects) instead.
269
-
- Reporter APIs `onCollected`, `onSpecsCollected`, `onPathsCollected`, `onTaskUpdate` and `onFinished`. See [`Reporters API`](/advanced/api/reporters) for new alternatives. These APIs were introduced in Vitest `v3.0.0`.
270
282
-`deps.external`, `deps.inline`, `deps.fallbackCJS` config options. Use `server.deps.external`, `server.deps.inline`, or `server.deps.fallbackCJS` instead.
271
283
-`browser.testerScripts` config option. Use [`browser.testerHtmlPath`](/guide/browser/config#browser-testerhtmlpath) instead.
272
284
-`minWorkers` config option. Only `maxWorkers` has any effect on how tests are running, so we are removing this public option.
If there is only one test file running, Vitest will output the full test tree of that file, simillar to the [`tree`](#tree-reporter) reporter. The default reporter will also print the test tree if there is at least one failed test in the file.
Verbose reporter is same as `default` reporter, but it also displays each individual test after the suite has finished. It also displays currently running tests that are taking longer than [`slowTestThreshold`](/config/#slowtestthreshold). Similar to `default` reporter, you can disable the summary by configuring the reporter.
160
+
The verbose reporter prints every test case once it is finished. It does not report suites or files separately. If `--includeTaskLocation` is enabled, it will also include the location of each test in the output. Similar to `default` reporter, you can disable the summary by configuring the reporter.
161
+
162
+
In addition to this, the `verbose` reporter prints test error messages right away. The full test error is reported when the test run is finished.
163
+
164
+
This is the only terminal reporter that reports [annotations](/guide/test-annotations) when the test doesn't fail.
The tree reporter is same as `default` reporter, but it also displays each individual test after the suite has finished. Similar to `default` reporter, you can disable the summary by configuring the reporter.
213
+
214
+
:::code-group
215
+
```bash [CLI]
216
+
npx vitest --reporter=tree
217
+
```
218
+
219
+
```ts [vitest.config.ts]
220
+
exportdefaultdefineConfig({
221
+
test: {
222
+
reporters: [
223
+
['tree', { summary: false }]
224
+
]
225
+
},
226
+
})
227
+
```
228
+
:::
229
+
164
230
Example output for tests in progress with default `slowTestThreshold: 300`:
Copy file name to clipboardExpand all lines: docs/guide/test-annotations.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
@@ -53,7 +53,7 @@ Error: thrown error
53
53
54
54
### verbose
55
55
56
-
In a TTY terminal, the `verbose` reporter works similarly to the `default` reporter. However, in a non-TTY environment, the `verbose`reporter will also print annotations after every test.
56
+
The `verbose` reporter is the only terminal reporter that reports annotations when the test doesn't fail.
57
57
58
58
```
59
59
✓ example.test.js > an example of a test with annotation
0 commit comments