vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
740 stars 83 forks source link

Vitest nodejs tests do not run - CAC error #304

Closed nathanielfinkgapmaps closed 5 months ago

nathanielfinkgapmaps commented 5 months ago

Describe the bug

Looks like it's having trouble with another library. Debug console says "Please start a debug session to evaluate expressions". There doesn't seem to be any discussion about this anywhere.

/home/user/.nvm/versions/node/v18.19.1/bin/node ./node_modules/vitest/vitest.mjs run vitest --silent=false --disable-console-intercept path/__test__/test.mjs -t Test Controller Test testUnit --api.port 36015 --api.host 127.0.0.1
Uncaught CACError CACError: Unknown option `--disableConsoleIntercept`
    at checkUnknownOptions (path/node_modules/cac/dist/index.mjs:400:17)
    at runMatchedCommand (path/node_modules/cac/dist/index.mjs:598:13)
    at parse (path/node_modules/cac/dist/index.mjs:537:12)
    at <anonymous> (path/node_modules/vitest/dist/cli.js:72:7)
    at run (internal/modules/esm/module_job:195:25)
No debugger available, can not send 'variables'
Process exited with code 1

Reproduction

Run any test from within vscode

System Info

Ubuntu 23.10, vscode 1.87.2, vitest 0.4.1

Used Package Manager

npm

Validations

sheremet-va commented 5 months ago

The latest version is 0.5.6 (pre-release).

nathanielfinkgapmaps commented 5 months ago

The latest version is 0.5.6 (pre-release).

Happens in this version as well. It looks like it's happening somewhere in the vitest code. There is no string --disableConsoleIntercept anywhere that I can see, though. So I don't know why it's complaining about this option.

Here is my version of CAC: "node_modules/cac": { "version": "6.7.14",

sheremet-va commented 5 months ago

Happens in this version as well

It cannot happen with that version because we don't use Vitest CLI at all.

github-actions[bot] commented 5 months ago

Hello @nathanielfinkgapmaps. Please provide a minimal reproduction using a GitHub repository or StackBlitz (you can also use examples). Issues marked with needs reproduction will be closed if they have no activity within 3 days.

nathanielfinkgapmaps commented 5 months ago

Turned out to be an issue with conflicting module versions