Debugging Tests in Vitest
From the Vitest cheat sheet ยท Performance & Debugging ยท verified Nov 2026
Debugging Tests
Attach a debugger, use Vitest UI, and track down noisy or hanging runs
bash
vitest --inspect-brk --no-file-parallelism # attach via chrome://inspect
vitest --ui # visual runner (@vitest/ui)
vitest run --reporter=hanging-process # why won't it exit?๐ก --no-file-parallelism keeps one file at a time so breakpoints hit
๐ Vitest UI needs the token URL that Vitest prints (v5)
โก The VS Code extension runs and debugs one test in a click
๐ detectAsyncLeaks is slow; turn it on only while debugging
debugginginspectui
Continue with Vitest
Save the full cheat sheet or work through every related task.