vitest-dev / vscode

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

`root` field is not appended to `include` paths. #402

Closed rtvu closed 4 months ago

rtvu commented 4 months ago

Describe the bug

Extension does not use the root field in vite.config.js. Extension assumes that root is the project's root folder.

If root is defined to be ./src, then on the command line, vitest will only see test files under ./src. However, the extension looks for all files within the project's root which can be outside of ./src.

Reproduction

https://github.com/rtvu/vitest-ext

Output

[INFO 6:10:57 AM] [v0.10.7] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 6:10:57 AM] [API] Running Vitest: v1.6.0 (vite.config.js)
[INFO 6:10:57 AM] [API] Starting Vitest process with Node.js: /home/user/.nvm/versions/node/v20.14.0/bin/node
[INFO 6:10:57 AM] [API] Vitest process 1065 created
[INFO 6:11:03 AM] [API] Collecting tests: should-not-see.test.js, src/should-see.test.js
[INFO 6:11:09 AM] Running all tests in workspace

Version

v0.10.7

Validations