Skip to content

Commit

Permalink
Merge pull request #8 from digitalservicebund/sonar-with-coverage
Browse files Browse the repository at this point in the history
Add coverage to sonar
  • Loading branch information
hannes-mk authored Dec 16, 2024
2 parents 513ab2b + 296638c commit fcd17cb
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions frontend/vitest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,46 @@ export default mergeConfig(
environment: 'jsdom',
exclude: [...configDefaults.exclude, 'e2e/**'],
root: fileURLToPath(new URL('./', import.meta.url)),
coverage: {
provider: 'v8',
reporter: ['lcov', 'text', 'html'],
// Changes to this also need to be reflected in the sonar-project.properties
exclude: [
// Configuration and generated outputs
'**/[.]**',
'coverage/**/*',
'dist/**/*',
'**/.*rc.{?(c|m)js,yml}',
'*.config.{js,ts}',

// Types
'**/*.d.ts',

// Tests
'test/**/*',
'e2e/**/*',

// App content we're not interested in covering with unit tests. If you
// add something here, please also add a comment explaining why the
// exclusion is necessary.

// Views are too complex too set up and mock in unit tests, we're covering
// those with E2E test instead. (App is also a view)
'src/views/**/*',
'src/App.vue',

// If necessary to use e.g. guards, we'll have a router-guards file that
// then should be tested
'src/router.ts',

// Just the init file, nothing much to test here.
'src/main.ts',

// Stories are just for internal development use and don't need to be
// tested
'src/**/*.story.vue',
],
},
},
}),
)

0 comments on commit fcd17cb

Please sign in to comment.