Windows space in folder not allowed
Closed this issue · 2 comments
deka commented
Describe the bug
On windows, When folder name has spaces, command line to run test fail.
To Reproduce
Run vitest on widows with a folder name with spaces
Expected behavior
Support space in folder names
Screenshots
Example error :
[INFO 14:38:16] Vitest Workspace [npm - package-with-space]: Vitest version = 0.25.8
[INFO 14:38:22] Tests run start
[INFO 14:38:22] [Workspace "npm - package-with-space] Run tests from workspace
[INFO 14:38:22] [Execute Vitest] d:/users/popol/git/npm - package-with-space/node_modules/.bin/vitest.cmd /users/popol/git/npm - package-with-space/src/components/PBtn.spec.ts -t "GIVEN PBtn WHEN default slot is used with text 'text'"
[INFO 14:38:22] Start api process at port 61954
[INFO 14:38:22] [RUN] d:/users/popol/git/npm - package-with-space/node_modules/.bin/vitest.cmd /users/popol/git/npm - package-with-space/src/components/PBtn.spec.ts -t "GIVEN PBtn WHEN default slot is used with text 'text'"
[INFO 14:38:22] [RUN.cwd] d:/users/popol/git/npm - package-with-space
[Error 14:38:22] Process exited with code 1
[INFO 14:38:22] 'd:/users/popol/git/npm' is not recognized as an internal or external command,
Environment
- OS: Windows
- VSCode version: 1.72
- Vitest version: 0.25.6
- Vitest plugin version: 0.2.36
dorin1000 commented
This issue came back it appears. In my case the package running the tests is part of a larger project, but VS Code is started from the package and not at the root of the larger project and the package folder is a VS Code workspace. The space in the path is at the level below the package running the test.
Running an individual test file from the extension with the default settings gives the following output:
[INFO 6:27:48 PM] Tests run start
[INFO 6:27:48 PM] [Workspace "package-name] Run tests from workspace
[INFO 6:27:48 PM] [Execute Vitest] c:/source/project-root/Folder With - Space/FrontendPackages/packages/package-name/node_modules/.bin/vitest.cmd /source/project-root/Folder With - Space/FrontendPackages/packages/package-name/src/__tests__/testFile.spec.ts
[INFO 6:27:48 PM] Start api process at port 49706
[INFO 6:27:48 PM] [RUN] c:/source/project-root/Folder With - Space/FrontendPackages/packages/package-name/node_modules/.bin/vitest.cmd /source/project-root/Folder With - Space/FrontendPackages/packages/package-name/src/__tests__/testFile.spec.ts
[INFO 6:27:48 PM] [RUN.cwd] c:/source/project-root/Folder With - Space/FrontendPackages/packages/package-name
[INFO 6:27:48 PM] WS Close
[Error 6:27:48 PM] Process exited with code 1
[INFO 6:27:48 PM] 'c:/source/project-root/Folder' is not recognized as an internal or external command,
operable program or batch file.
[INFO 6:27:49 PM] RECONNECT
[INFO 6:27:49 PM] WS Close
Environment:
- OS: Windows 10
- VS Code version: 1.75.1
- Package manager: pnpm v7.27.0
- Vitest version: 0.28.3
- Vitest VS Code extension version: 0.2.39