vitest.web.config.ts 1.3 KB

1234567891011121314151617181920212223242526272829303132333435
  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. ],
  28. // Browser boot + real-model turns are slow; files share one browser, run serial.
  29. testTimeout: 180_000,
  30. hookTimeout: 120_000,
  31. fileParallelism: false,
  32. },
  33. })