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.

More Vitest tasks

Back to the full Vitest cheat sheet