vitest.web.config.ts 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  1. import tsconfigPaths from 'vite-tsconfig-paths'
  2. import { defineConfig } from 'vitest/config'
  3. // Web browser lane (GUI, gate-exempt — not part of the CI sequence yet): real
  4. // host entry points, built-client interaction snapshots, and the replayed
  5. // keyless e2e scenarios, outside the unit/e2e includes. Real-model cases
  6. // self-skip without DEEPSEEK_API_KEY; fixture branches and replay stay
  7. // keyless and deterministic.
  8. // TODO(ci-browser): running this lane in CI requires chromium provisioning
  9. // and reverses the no-browser-in-CI ruling — staged criteria in
  10. // .agents/notes/implemented/testing/2026-07-24-web-gui-browser-e2e-lane.md.
  11. try {
  12. // Node >= 21.7 native; throws when the file does not exist.
  13. process.loadEnvFile(new URL('.env', import.meta.url).pathname)
  14. } catch {
  15. // No .env — fine, the environment may already carry the variables.
  16. }
  17. export default defineConfig({
  18. // Same resolution note as vitest.config.ts: the tsconfig.base.json paths
  19. // facade has no include (match-all), so apps/web/tests resolves bare
  20. // workspace imports to source like every other lane.
  21. plugins: [tsconfigPaths({ projects: ['./tsconfig.base.json'] })],
  22. test: {
  23. include: [
  24. 'apps/web/tests/**/*.e2e.ts',
  25. 'apps/web/tests/**/*.snapshot.ts',
  26. ],
  27. // Browser boot + real-model turns are slow; files share one browser, run serial.
  28. testTimeout: 180_000,
  29. hookTimeout: 120_000,
  30. fileParallelism: false,
  31. },
  32. })