Reputation: 2301
How to exclude a directory from coverage report in vitest?
I'm looking for something like coveragePathIgnorePatterns
option as it was in jest:
coveragePathIgnorePatterns: [
'<rootDir>/src/foo.ts',
'<rootDir>/src/bar.ts',
....
],
How could I do that in vitest.config.ts
?
Upvotes: 7
Views: 4646
Reputation: 334
inside coverage
you need to add exclude ignore pattern.
then it will work. like this:
in vite.config.ts
{
...
test: {
...,
coverage: {
provider: 'istanbul',
exclude: ['src/config/**']
}
}
}
Don't add it outside the coverage.didn't work for me.
Upvotes: 14