[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

feat: support config junit reporter className with env (#3808)

authored by

InfiniteXyy and committed by
GitHub
(Jul 28, 2023, 12:03 PM +0200) e8bc46b6 f3bd9102

+2 -2
+1 -1
docs/config/index.md
··· 486 486 - `'basic'` - give a reporter like default reporter in ci 487 487 - `'verbose'` - keep the full task tree visible 488 488 - `'dot'` - show each task as a single dot 489 - - `'junit'` - JUnit XML reporter (you can configure `testsuites` tag name with `VITEST_JUNIT_SUITE_NAME` environmental variable) 489 + - `'junit'` - JUnit XML reporter (you can configure `testsuites` tag name with `VITEST_JUNIT_SUITE_NAME` environmental variable, and `classname` tag property with `VITEST_JUNIT_CLASSNAME`) 490 490 - `'json'` - give a simple JSON summary 491 491 - `'html'` - outputs HTML report based on [`@vitest/ui`](/guide/ui) 492 492 - `'hanging-process'` - displays a list of hanging processes, if Vitest cannot exit process safely. This might be a heavy operation, enable it only if Vitest consistently cannot exit process
+1 -1
packages/vitest/src/node/reporters/junit.ts
··· 168 168 async writeTasks(tasks: Task[], filename: string): Promise<void> { 169 169 for (const task of tasks) { 170 170 await this.writeElement('testcase', { 171 - classname: filename, 171 + classname: process.env.VITEST_JUNIT_CLASSNAME ?? filename, 172 172 name: task.name, 173 173 time: getDuration(task), 174 174 }, async () => {