Skip to content

Issue with Overwriting Default Exclude Patterns in Coverage Configuration #5462

Answered by AriPerkkio
Evgenios95 asked this question in Q&A
Discussion options

You must be logged in to vote

You'll need to extend the default values. I was just updating this to the documentation: 59c71d2

This option overrides all default options. Extend the default options when adding new patterns to ignore:

import { coverageConfigDefaults, defineConfig } from 'vitest/config'

export default defineConfig({
  test: {
    coverage: {
      exclude: ['**/custom-pattern/**', ...coverageConfigDefaults.exclude]
    },
  },
})

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Evgenios95
Comment options

Answer selected by Evgenios95
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants