vitest.config.ts 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. import { defineConfig } from 'vitest/config'
  2. import { resolve } from 'path'
  3. import vue from '@vitejs/plugin-vue'
  4. export default defineConfig({
  5. plugins: [vue()],
  6. // Match the production runtime's CSP-safe message interpretation.
  7. define: { __INTLIFY_JIT_COMPILATION__: true },
  8. resolve: {
  9. alias: {
  10. '@': resolve(__dirname, 'src'),
  11. 'vue-i18n': 'vue-i18n/dist/vue-i18n.runtime.esm-bundler.js'
  12. }
  13. },
  14. test: {
  15. globals: true,
  16. environment: 'jsdom',
  17. setupFiles: ['./src/__tests__/setup.ts'],
  18. include: ['src/**/*.{test,spec}.{js,ts,jsx,tsx}'],
  19. exclude: ['node_modules', 'dist'],
  20. coverage: {
  21. provider: 'v8',
  22. reporter: ['text', 'json', 'html'],
  23. include: ['src/**/*.{js,ts,vue}'],
  24. exclude: [
  25. 'node_modules',
  26. 'src/**/*.d.ts',
  27. 'src/**/*.spec.ts',
  28. 'src/**/*.test.ts',
  29. 'src/main.ts'
  30. ],
  31. thresholds: {
  32. global: {
  33. statements: 80,
  34. branches: 80,
  35. functions: 80,
  36. lines: 80
  37. }
  38. }
  39. }
  40. }
  41. })