vitest.config.ts 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. setupFiles: 'scripts/setup-vitest.ts',
  26. environmentMatchGlobs: [
  27. ['packages/{vue,vue-compat,runtime-dom}/**', 'jsdom'],
  28. ],
  29. sequence: {
  30. hooks: 'list',
  31. },
  32. coverage: {
  33. provider: 'istanbul',
  34. reporter: ['text', 'html'],
  35. exclude: [
  36. ...configDefaults.coverage.exclude!,
  37. // DOM transitions are tested via e2e so no coverage is collected
  38. 'packages/runtime-dom/src/components/Transition*',
  39. // mostly entries
  40. 'packages/vue-compat/**',
  41. 'packages-private/**',
  42. 'scripts/**',
  43. ],
  44. },
  45. },
  46. })