vitest.config.ts 908 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import { fileURLToPath, URL } from 'node:url'
  2. import { defineConfig } from 'vitest/config'
  3. import vue from '@vitejs/plugin-vue'
  4. export default defineConfig({
  5. plugins: [vue()],
  6. resolve: {
  7. alias: {
  8. '@': fileURLToPath(new URL('./src', import.meta.url))
  9. }
  10. },
  11. test: {
  12. environment: 'happy-dom',
  13. include: ['tests/unit/**/*.{test,spec}.ts'],
  14. globals: true,
  15. setupFiles: ['./vitest.setup.ts'],
  16. coverage: {
  17. provider: 'v8',
  18. reporter: ['text', 'text-summary', 'html', 'lcov'],
  19. reportsDirectory: './coverage',
  20. include: ['src/**/*.ts', 'src/**/*.vue'],
  21. exclude: [
  22. 'src/main.ts',
  23. 'src/env.d.ts',
  24. 'src/**/*.d.ts',
  25. 'src/types/**'
  26. ],
  27. // Coverage thresholds - can be gradually increased
  28. thresholds: {
  29. statements: 5,
  30. branches: 5,
  31. functions: 3,
  32. lines: 5
  33. }
  34. }
  35. }
  36. })