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
Copy file name to clipboardexpand all lines: docs/guide/reporters.md
+29-1
Original file line number
Diff line number
Diff line change
@@ -26,6 +26,23 @@ export default defineConfig({
26
26
})
27
27
```
28
28
29
+
Some reporters can be customized by passing additional options to them. Reporter specific options are described in sections below.
30
+
31
+
:::tip
32
+
Since Vitest v1.3.0
33
+
:::
34
+
35
+
```ts
36
+
exportdefaultdefineConfig({
37
+
test: {
38
+
reporters: [
39
+
'default',
40
+
['junit', { suiteName: 'UI tests' }]
41
+
],
42
+
},
43
+
})
44
+
```
45
+
29
46
## Reporter Output
30
47
31
48
By default, Vitest's reporters will print their output to the terminal. When using the `json`, `html` or `junit` reporters, you can instead write your tests' output to a file by including an `outputFile`[configuration option](/config/#outputfile) either in your Vite configuration file or via CLI.
@@ -234,7 +251,18 @@ AssertionError: expected 5 to be 4 // Object.is equality
234
251
</testsuite>
235
252
</testsuites>
236
253
```
237
-
The outputted XML contains nested `testsuites` and `testcase` tags. You can use the environment variables `VITEST_JUNIT_SUITE_NAME` and `VITEST_JUNIT_CLASSNAME` to configure their `name` and `classname` attributes, respectively.
254
+
255
+
The outputted XML contains nested `testsuites` and `testcase` tags. You can use the environment variables `VITEST_JUNIT_SUITE_NAME` and `VITEST_JUNIT_CLASSNAME` to configure their `name` and `classname` attributes, respectively. These can also be customized via reporter options:
256
+
257
+
```ts
258
+
exportdefaultdefineConfig({
259
+
test: {
260
+
reporters: [
261
+
['junit', { suiteName: 'custom suite name', classname: 'custom-classname' }]
0 commit comments