v1.1.0 - custom options support
This release adds support for passing custom reporter options. See vitest-dev/vitest#5111 for more information about Vitest's new reporter API. There's also new onWritePath
option that can be used to rewrite <file>
element's path
attributes.
Custom options
import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
reporters: [
"default",
["vitest-sonar-reporter", { outputFile: "sonar-report.xml", silent: true }],
"junit",
],
},
});
onWritePath
option
import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
reporters: [
['vitest-sonar-reporter', {
onWritePath(path: string) {
console.log(path);
// ^^^^ "test/fixtures/animals.test.ts"
return `custom-prefix/${path}`;
}
}],
],
},
});
<testExecutions version="1">
- <file path="test/fixtures/animals.test.ts">
+ <file path="custom-prefix/test/fixtures/animals.test.ts">
<testCase name="animals - dogs say woof" duration="123" />
</file>
</testExecutions>
What's Changed
- feat: support custom options by @AriPerkkio in #160
- feat: add support for rewriting
<file path="...">
attributes by @AriPerkkio in #154
Full Changelog: v1.0.0...v1.1.0