Skip to content

Commit

Permalink
docs: mention default reporter
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Mar 13, 2024
1 parent e1fd01c commit 92d89b4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import { defineConfig } from 'vitest/config';
export default defineConfig({
test: {
reporters: [
'default', // Vitest's default reporter so that terminal output is still visible
['vitest-sonar-reporter', { outputFile: 'sonar-report.xml' }],
],
},
Expand All @@ -60,9 +61,6 @@ Instruct SonarQube to pick report in your [`sonar-project.properties`](https://d
sonar.testExecutionReportPaths=sonar-report.xml
```

- ❌ Do not `import` reporter as `import SonarReporter from 'vitest-sonar-reporter';`
- ✅ Define reporter as `reporters: ['vitest-sonar-reporter']` so that `vitest` will process it. This quarantees support for projects without `{ type: 'module' }`.

### Options

You can pass additional options to reporter. Note that this requires `vitest@^1.3.0`.
Expand Down

0 comments on commit 92d89b4

Please sign in to comment.