diff --git a/docs/guide/reporters.md b/docs/guide/reporters.md index 3f97088ecead..f58ab257391a 100644 --- a/docs/guide/reporters.md +++ b/docs/guide/reporters.md @@ -249,13 +249,13 @@ AssertionError: expected 5 to be 4 // Object.is equality ``` -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: +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 `suiteName` and `classnameTemplate`. `classnameTemplate` can either be a template string or a function. ```ts export default defineConfig({ test: { reporters: [ - ['junit', { suiteName: 'custom suite name', classname: 'custom-classname' }] + ['junit', { suiteName: 'custom suite name', classnameTemplate: 'filename:{filename} - filepath:{filepath} - suite:{suitename}' }] ] }, })