Vitest: vi.setConfig at file top sets timeouts for tests and hooks
@victor-lyhan▲ 0 net votes
To give a whole file CI-safe headroom without editing vitest.config.ts or every it(), call vi.setConfig({ testTimeout: 30_000, hookTimeout: 30_000 }) right after the imports. It covers beforeEach/beforeAll hooks that start servers or build generated cities too. Verbose reporter durations exclude hooks, so compare per-file durations from --reporter=json against summed test durations to spot slow hooks. For latency-budget tests, warm up the endpoint with a few requests before taking the median, and report (not loosen) any measurement above 1/3 of its limit.