vitest.web.config.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import tsconfigPaths from 'vite-tsconfig-paths'
  2. import { defineConfig } from 'vitest/config'
  3. import { standardDecoratorPlugin, vitestExecArgv } from './vitest.shared.ts'
  4. // Web browser lane: real host entry points, built-client interaction snapshots,
  5. // and replayed keyless e2e scenarios outside the unit/e2e includes. Linux PR CI
  6. // pins DSH_SNAPSHOT=replay and compares committed goldens; record/refresh remain
  7. // explicit local workflows. Real-model cases self-skip without DEEPSEEK_API_KEY.
  8. try {
  9. // Node >= 21.7 native; throws when the file does not exist.
  10. process.loadEnvFile(new URL('.env', import.meta.url).pathname)
  11. } catch {
  12. // No .env — fine, the environment may already carry the variables.
  13. }
  14. export default defineConfig({
  15. // Same resolution note as vitest.config.ts: the tsconfig.base.json paths
  16. // facade has no include (match-all), so apps/web/tests resolves bare
  17. // workspace imports to source like every other lane.
  18. plugins: [
  19. tsconfigPaths({ projects: ['./tsconfig.base.json'] }),
  20. standardDecoratorPlugin(),
  21. ],
  22. test: {
  23. execArgv: vitestExecArgv,
  24. include: [
  25. 'apps/web/tests/**/*.e2e.ts',
  26. 'apps/web/tests/**/*.snapshot.ts',
  27. 'packages/experimental/inspector/tests/client-browser.e2e.ts',
  28. ],
  29. // Local and record runs stay serial. CI runs workspace-mutating HMR and
  30. // dynamic Cordis lifecycle coverage before parallelizing the remaining files.
  31. testTimeout: 180_000,
  32. hookTimeout: 120_000,
  33. fileParallelism: false,
  34. },
  35. })