vitest.web.config.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132
  1. import tsconfigPaths from 'vite-tsconfig-paths'
  2. import { defineConfig } from 'vitest/config'
  3. import { 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: [tsconfigPaths({ projects: ['./tsconfig.base.json'] })],
  19. test: {
  20. execArgv: vitestExecArgv,
  21. include: [
  22. 'apps/web/tests/**/*.e2e.ts',
  23. 'apps/web/tests/**/*.snapshot.ts',
  24. ],
  25. // Browser boot + real-model turns are slow; files share one browser, run serial.
  26. testTimeout: 180_000,
  27. hookTimeout: 120_000,
  28. fileParallelism: false,
  29. },
  30. })