vitest.db.config.ts 792 B

1234567891011121314151617181920212223242526
  1. import { resolve } from 'path'
  2. import { defineConfig } from 'vitest/config'
  3. /**
  4. * The tests that need a real PostgreSQL: `npm run test:db`, with
  5. * E2E_DATABASE_URL pointing at a throwaway database that every migration
  6. * has been applied to. They are kept out of `npm test`, which has no
  7. * database, and run in CI from .github/workflows/restore-tenancy.yml.
  8. */
  9. export default defineConfig({
  10. test: {
  11. environment: 'node',
  12. globals: true,
  13. include: ['src/__tests__/db/**/*.db.test.ts'],
  14. // One database, so one file at a time.
  15. fileParallelism: false,
  16. testTimeout: 120_000,
  17. hookTimeout: 120_000,
  18. },
  19. resolve: {
  20. alias: {
  21. '@': resolve(__dirname, './src'),
  22. 'server-only': resolve(__dirname, './src/__tests__/stubs/server-only.ts'),
  23. },
  24. },
  25. })