MaxM
Deno9mo ago
Max

Debugging tests with Vitest

I am trying to launch tests in debugger. According to vitest documentation https://vitest.dev/guide/debugging.html#node-inspector-e-g-chrome-devtools running it as
vitest --inspect-brk --no-file-parallelism
should work just fine. So I tried:

deno run -A npm:vitest --inspect-brk --no-file-parallelism


But it doesn't launch a debugger - it just runs tests as usual.

Adding
--inspect-brk
to Deno itself, like:

deno run -A --inspect-brk npm:vitest --inspect-brk --no-file-parallelism


It starts a debugger, but when I attach to it from vscode, it never stop on breakpoints inside tests.

What is a way to debug tests using Vitest in Deno?

Thank you.
Next generation testing framework powered by Vite
Was this page helpful?