2025-11-22 16:42:35 +01:00
|
|
|
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',
|
2025-11-22 19:49:53 +01:00
|
|
|
reporter: ['text', 'json', 'html', 'lcov'],
|
2025-11-23 13:13:16 +01:00
|
|
|
all: true,
|
2025-11-22 16:42:35 +01:00
|
|
|
include: [
|
2025-11-23 13:13:16 +01:00
|
|
|
'app/**/*.{ts,js,vue}',
|
2025-11-22 16:42:35 +01:00
|
|
|
],
|
|
|
|
|
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'],
|
|
|
|
|
},
|
|
|
|
|
})
|