From 2e3dc97e3b483b6f8d127545e4688d5d50d7feb2 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Leclerc Date: Mon, 11 Nov 2024 17:01:06 -0500 Subject: [PATCH] feat(reporter): Sightly improved documentation for junit reporter and fixed typo. Change-Id: Ie77e0955011fa42d2a8ef42c074327589d780739 --- docs/guide/reporters.md | 5 +++++ packages/vitest/src/node/reporters/junit.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/guide/reporters.md b/docs/guide/reporters.md index f58ab257391a..9ebfc1b21aa8 100644 --- a/docs/guide/reporters.md +++ b/docs/guide/reporters.md @@ -251,6 +251,11 @@ 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 `suiteName` and `classnameTemplate`. `classnameTemplate` can either be a template string or a function. +The supported placeholders for the `classnameTemplate` option are: +- filename +- filepath +- suitename + ```ts export default defineConfig({ test: { diff --git a/packages/vitest/src/node/reporters/junit.ts b/packages/vitest/src/node/reporters/junit.ts index 949eeba3eae0..e66961573a07 100644 --- a/packages/vitest/src/node/reporters/junit.ts +++ b/packages/vitest/src/node/reporters/junit.ts @@ -19,7 +19,7 @@ interface ClassnameTemplateVariables { export interface JUnitOptions { outputFile?: string - /** @deprecated Use `classnameTempalte` instead. */ + /** @deprecated Use `classnameTemplate` instead. */ classname?: string /**