vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Unable to debug Vitest test in the browser or webstorm

Open quantuminformation opened this issue 3 years ago • 0 comments

Describe the bug

It's almost impossible to write unit tests been able to debug.

I already failed in webstorm: https://youtrack.jetbrains.com/issue/WEB-56836/Vitest-debugging

And failed in the browser? I tried node --inspect ./node_modules/vitest/vitest.mjs

If I try the above and have brave://inspect/#devices open the test runs but no breakpoints (via debugger statement) are hit.

I can't find any tutorials on this either

Reproduction

This issue can also be found in a new vite react project: https://github.com/quantuminformation/vite-project:

image

System Info

System:
    OS: macOS 12.5
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 43.16 MB / 16.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.13.2 - ~/.nvm/versions/node/v16.13.2/bin/node
    Yarn: 1.19.2 - /usr/local/bin/yarn
    npm: 8.1.2 - ~/.nvm/versions/node/v16.13.2/bin/npm
  Browsers:
    Brave Browser: 103.1.41.100
    Firefox: 103.0.1
    Safari: 15.6
  npmPackages:
    @vitejs/plugin-react: ^2.0.0 => 2.0.0
    vite: ^3.0.0 => 3.0.3
    vitest: ^0.16.0 => 0.16.0

Used Package Manager

npm

Validations

quantuminformation avatar Aug 05 '22 13:08 quantuminformation