1e31678d06
Add the 'all' option to the coverage configuration to ensure that all files are included in the coverage reports. This improves the accuracy of the coverage metrics by encompassing all relevant source files.
50 lines
1.2 KiB
TypeScript
50 lines
1.2 KiB
TypeScript
import vue from '@vitejs/plugin-vue'
|
|
import { dirname,resolve } from 'path'
|
|
import { fileURLToPath } from 'url'
|
|
import { defineConfig } from 'vitest/config'
|
|
|
|
const __filename = fileURLToPath(import.meta.url)
|
|
const __dirname = dirname(__filename)
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
test: {
|
|
environment: 'jsdom',
|
|
globals: true,
|
|
setupFiles: ['./test/setup.ts'],
|
|
coverage: {
|
|
provider: 'v8',
|
|
reporter: ['text', 'json', 'html', 'lcov'],
|
|
all: true,
|
|
include: [
|
|
'app/**/*.{ts,js,vue}',
|
|
],
|
|
exclude: [
|
|
'app/graphql/generated.ts', // GraphQL generated code
|
|
'**/*.d.ts',
|
|
'**/*.config.*',
|
|
'**/node_modules/**',
|
|
'**/test/**',
|
|
'**/__tests__/**',
|
|
'**/*.spec.ts',
|
|
'**/*.test.ts',
|
|
],
|
|
// TODO: Re-enable coverage thresholds once we have more test coverage
|
|
// thresholds: {
|
|
// statements: 70,
|
|
// branches: 70,
|
|
// functions: 70,
|
|
// lines: 70,
|
|
// },
|
|
},
|
|
},
|
|
resolve: {
|
|
alias: {
|
|
'~': resolve(__dirname, './app'),
|
|
'~~': resolve(__dirname, '.'),
|
|
'@': resolve(__dirname, './app'),
|
|
},
|
|
extensions: ['.js', '.ts', '.jsx', '.tsx', '.json', '.vue'],
|
|
},
|
|
})
|