Skip to content

Commit

Permalink
feat: allow extension option for coverage
Browse files Browse the repository at this point in the history
c8 v7.11.0 introduced an `extension` option, allowing to specify extensions that aren't covered by default (default are defined via https://github.com/istanbuljs/schema/blob/master/default-extension.js).
  • Loading branch information
cexbrayat committed Jan 13, 2022
1 parent b02447f commit 8142f0e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/vue/vitest.config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="vitest" />
import { defineConfig } from 'vite'
import Vue from '@vitejs/plugin-vue'

Expand All @@ -8,5 +9,9 @@ export default defineConfig({
test: {
global: true,
environment: 'happy-dom',
coverage: {
include: ['components/**/*'],
extension: ['.ts', '.vue'],
},
},
})
1 change: 1 addition & 0 deletions packages/vitest/src/coverage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export interface C8Options {
exclude?: string[]
include?: string[]
skipFull?: boolean
extension?: string | string[]

// c8 options, not sure if we should expose them
/**
Expand Down

0 comments on commit 8142f0e

Please sign in to comment.