vitest.config.ts 929 B

123456789101112131415161718192021222324252627282930313233343536
  1. import { defineConfig } from 'vitest/config';
  2. export default defineConfig({
  3. test: {
  4. globals: true,
  5. environment: 'node',
  6. include: ['tests/**/*.{test,spec}.{js,mjs,cjs,ts,mts,cts,jsx,tsx}'],
  7. coverage: {
  8. provider: 'v8',
  9. reporter: ['text', 'json', 'html'],
  10. exclude: [
  11. 'coverage/**',
  12. 'dist/**',
  13. '**/node_modules/**',
  14. '**/[.]**',
  15. '**/*.d.ts',
  16. '**/virtual:*',
  17. '**/__x00__*',
  18. '**/\x00*',
  19. 'cypress/**',
  20. 'test?(s)/**',
  21. 'test?(-*).?(c|m)[jt]s?(x)',
  22. '**/*{.,-}{test,spec,bench,benchmark}?(-d).?(c|m)[jt]s?(x)',
  23. '**/__tests__/**',
  24. '**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*',
  25. '**/vitest.config.*',
  26. '**/vitest.workspace.*'
  27. ]
  28. }
  29. },
  30. resolve: {
  31. alias: {
  32. '~': new URL('./src', import.meta.url).pathname
  33. }
  34. }
  35. });