vitest-sonar-reporter

SonarQube reporter for Vitest

MIT License

Downloads
279.2K
Stars
25
Committers
5
vitest-sonar-reporter - v2.0.0 Latest Release

Published by AriPerkkio 8 months ago

The old sonarReporterOptions.silent is no longer supported. Use custom reporter options instead:

export default defineConfig({
  test: {
-    reporters: 'vitest-sonar-reporter',
-    sonarReporterOptions: { silent: true }
+    reporters: ['vitest-sonar-reporter', { silent: true }],
  },
});

What's Changed

Full Changelog: https://github.com/AriPerkkio/vitest-sonar-reporter/compare/v1.1.0...v2.0.0

vitest-sonar-reporter - v1.1.0 - custom options support

Published by AriPerkkio 8 months ago

This release adds support for passing custom reporter options. See https://github.com/vitest-dev/vitest/pull/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

Full Changelog: https://github.com/AriPerkkio/vitest-sonar-reporter/compare/v1.0.0...v1.1.0

vitest-sonar-reporter - v1.0.0 - Support Vitest 1.0

Published by AriPerkkio 11 months ago

vitest-sonar-reporter - v0.5.0 - Support [email protected]

Published by AriPerkkio about 1 year ago

vitest-sonar-reporter - v0.4.1 - Workspace support fixed

Published by AriPerkkio over 1 year ago

vitest-sonar-reporter - v0.4.0

Published by AriPerkkio over 1 year ago