-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Windows] vitest exits silently without watching or printing coverage when using canvas #2261
Comments
(Vitest won't clear the terminal in the next version) |
I've narrowed this down to likely be an issue on Windows specifically. I cannot reproduce any of the failing cases provided above on Ubuntu (via WSL2). I've updated the original report accordingly. |
Is it still an issue? |
@sheremet-va I’m afraid so. I’ve checked this again a few days ago and updated the original report with (newer) affected versions. |
This depends on the shell you are using. Linux automatically wraps this and passed down an array of files. Vitest only does regexp with these files. |
I have same problem but maybe this stack trace helps (works on linux)
|
@mendrik Not sure this is caused by the same underlying issue. I'm not getting any errors when running the commands above. For me, it prints the regular test output and then:
After which it simply exits. |
After updating several dependencies in my project, I can no longer reproduce this issue. All commands reported as failing above now behave as expected. The following dependencies related to this issue were updated (most likely a change in https://github.com/vitest-dev/vitest/releases/tag/v0.29.0 fixes the reported issue):
|
I'm reopening this because this issue is only addressed as long as I don't enable As part of https://github.com/vitest-dev/vitest/releases/tag/v0.29.0, #740 was fixed by offering the alternative to set
Now, while keeping |
I've updated the original post to reflect current package versions and using |
Trying to find where this breaks in the vitest code, stepping through code in the vendor-node bundle. I'm running some of the commands from my original post above in both a Windows and an Ubuntu environment. I noticed that in
When This all sounds like a race condition somewhere. Maybe something in More notes:
|
I think I figured out why this happens. One of the files in my project (src/utilities/parse-props-color.js) uses canvas ( It's surprising that the tests don't crash or throw an error of a sort. How come it just silently exits? |
The Vitest 1.0.0 has now If the code you are testing is incompatible with |
|
Describe the bug
(It seems the issue described here applies to Windows only. All failing cases listed below pass on Ubuntu via WSL2 in Windows but fail in Windows PowerShell.)
For some runs of vitest,
Reproduction
npm install
.test.singleThread
totrue
in vite.config.js.npx vitest
❌ doesn't watch
npx vitest .\src\utilities\
❌ doesn't watch
npx vitest --coverage
❌ doesn't watch, doesn't print coverage report
npx vitest --coverage .\src\utilities\
❌ doesn't watch, doesn't print coverage report
npx vitest run --coverage
❌ doesn't print coverage report
npx vitest run --coverage .\src\utilities\
❌ doesn't print coverage report
npx vitest .\src\utilities\color-conversions\
✅ watches
npx vitest --coverage .\src\utilities\color-conversions\
✅ watches, prints coverage report
npx vitest run --coverage .\src\utilities\color-conversions\
✅ prints coverage report
More context
npx vitest run --coverage .\src
✅
npx vitest run --coverage .\src\**\*.test.js
❌ prints "No test files found, exiting with code 1"
npx vitest run --coverage .\src\utilities\*.test.js
❌ prints "No test files found, exiting with code 1"
npx vitest run --coverage .\src\utilities\**\*.test.js
❌ prints "No test files found, exiting with code 1"
System Info
Used Package Manager
npm
Validations
The text was updated successfully, but these errors were encountered: