vitest.web.config.ts 1.2 KB

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