vitest.config.ts 809 B

1234567891011121314151617181920
  1. import { defineConfig } from 'vitest/config';
  2. import { realpathSync } from 'node:fs';
  3. import { tmpdir } from 'node:os';
  4. // Windows runners expose an 8.3 TEMP alias; fixtures and fault-injection mocks
  5. // must use the same canonical path that the filesystem returns to production.
  6. const testTemp = realpathSync.native(tmpdir());
  7. export default defineConfig({
  8. test: {
  9. include: ['packages/*/tests/**/*.spec.ts', 'packages/*/src/**/*.spec.ts'],
  10. environment: 'node',
  11. // Many integration files spawn Git/Node processes; bound contention on CI.
  12. maxWorkers: process.env['CI'] ? 2 : 4,
  13. testTimeout: 15_000,
  14. // afterAll fixture removal retries on slow Windows runners can exceed the 10s default.
  15. hookTimeout: 60_000,
  16. env: { TEMP: testTemp, TMP: testTemp, TMPDIR: testTemp },
  17. },
  18. });