adev/src/content/guide/testing/debugging.md
If your tests aren't working as you expect, you can debug them in both the default Node.js environment and in a real browser.
Debugging in the default Node.js environment is often the quickest way to diagnose issues that are not related to browser-specific APIs or rendering.
ng test command with the --debug flag:
ng test --debug
The same way you start a debugging session with in Node, you can use ng test with the --debug flag with Vitest and browser mode.
The test runner will start in debug mode and wait for you to open the browser devtools to debug the tests.