Skip to content

Commit

Permalink
feat(reporter): Sightly improved documentation for junit reporter and…
Browse files Browse the repository at this point in the history
… fixed typo.

Change-Id: Ie77e0955011fa42d2a8ef42c074327589d780739
  • Loading branch information
Jean-Philippe Leclerc committed Nov 11, 2024
1 parent 04add0c commit 2e3dc97
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions docs/guide/reporters.md
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion packages/vitest/src/node/reporters/junit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ interface ClassnameTemplateVariables {

export interface JUnitOptions {
outputFile?: string
/** @deprecated Use `classnameTempalte` instead. */
/** @deprecated Use `classnameTemplate` instead. */
classname?: string

/**
Expand Down

0 comments on commit 2e3dc97

Please sign in to comment.