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,
- it doesn't watch. It does print the watch output (i.e. "Waiting for file changes...", etc.).
- it doesn't print a coverage report. It does print the coverage output (i.e. "% Coverage report from c8").
Reproduction
- Clone https://github.com/kleinfreund/vue-accessible-color-picker/tree/a650e7fd451e1ea23eeb2f95ce4d29ec8183b3c2 (sorry, can't reproduce this in a more minimal case but the repo should be small enough), run
npm install.
- Set
test.singleThread to true in vite.config.js.
- Run the following commands:
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
- Running tests using wildcards in path segments doesn't seem to work whatsoever. All the following runs produce the "No test files found, exiting with code 1" error. Path separator doesn't seem to matter; filter, include, exclude, and watch exclude values seem to all be correct and correctly normalized. I suspect this is some sort of lack of path resolving against the current working directory in Windows environments.
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"
- This is not related to Vue. I've ported the package to a separate web component and the exact same issue occurs in that project as well.
System Info
System:
OS: Windows 10 10.0.22621
CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz
Memory: 53.80 GB / 63.92 GB
Binaries:
Node: 20.5.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD
npm: 9.8.1 - ~\dev\vue-accessible-color-picker\node_modules\.bin\npm.CMD
npmPackages:
vite: ^4.4.8 => 4.4.8
vitest: ^0.34.1 => 0.34.1
Used Package Manager
npm
Validations
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.singleThreadtotruein 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
System: OS: Windows 10 10.0.22621 CPU: (16) x64 Intel(R) Core(TM) i9-9900K CPU @ 3.60GHz Memory: 53.80 GB / 63.92 GB Binaries: Node: 20.5.0 - C:\Program Files\nodejs\node.EXE Yarn: 1.22.19 - C:\Program Files\nodejs\yarn.CMD npm: 9.8.1 - ~\dev\vue-accessible-color-picker\node_modules\.bin\npm.CMD npmPackages: vite: ^4.4.8 => 4.4.8 vitest: ^0.34.1 => 0.34.1Used Package Manager
npm
Validations