vitest.config.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import { configDefaults, defineConfig } from 'vitest/config'
  2. import { entries } from './scripts/aliases.js'
  3. export default defineConfig({
  4. define: {
  5. __DEV__: true,
  6. __TEST__: true,
  7. __VERSION__: '"test"',
  8. __BROWSER__: false,
  9. __GLOBAL__: false,
  10. __ESM_BUNDLER__: true,
  11. __ESM_BROWSER__: false,
  12. __CJS__: true,
  13. __SSR__: true,
  14. __FEATURE_OPTIONS_API__: true,
  15. __FEATURE_SUSPENSE__: true,
  16. __FEATURE_PROD_DEVTOOLS__: false,
  17. __FEATURE_PROD_HYDRATION_MISMATCH_DETAILS__: false,
  18. __COMPAT__: true,
  19. },
  20. resolve: {
  21. alias: entries,
  22. },
  23. test: {
  24. globals: true,
  25. pool: 'threads',
  26. setupFiles: 'scripts/setup-vitest.ts',
  27. environmentMatchGlobs: [
  28. ['packages/{vue,vue-compat,runtime-dom}/**', 'jsdom'],
  29. ],
  30. sequence: {
  31. hooks: 'list',
  32. },
  33. coverage: {
  34. provider: 'istanbul',
  35. reporter: ['text', 'html'],
  36. exclude: [
  37. ...configDefaults.coverage.exclude!,
  38. // DOM transitions are tested via e2e so no coverage is collected
  39. 'packages/runtime-dom/src/components/Transition*',
  40. // mostly entries
  41. 'packages/vue-compat/**',
  42. 'packages-private/**',
  43. 'scripts/**',
  44. ],
  45. },
  46. },
  47. })