From 04add0c0fa9a7418497a6d442b06b2522494ae5d Mon Sep 17 00:00:00 2001 From: Jean-Philippe Leclerc Date: Thu, 7 Nov 2024 12:37:58 -0500 Subject: [PATCH] feat(reporter): Mention classnameTemplate in the doc Change-Id: I1caa6e359998071ced9839ad27d121d25e8b8d99 --- docs/guide/reporters.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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}' }] ] }, })