You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
vitest will simply exit if the test contains an unexpected process.exit call, this may be very bad for troubleshooting some asynchronous tasks from from dependencies.
Describe the bug
vitest
will simply exit if the test contains an unexpectedprocess.exit
call, this may be very bad for troubleshooting some asynchronous tasks from from dependencies.Reproduction
minimal reproduction: vitest-simply-exits-when-met-process-exit-repro, see following repro steps:
git clone https://github.com/ulivz/vitest-simply-exits-when-met-process-exit-repro
pnpm i
npm run test
, you will notice thatvitest
process will exit and not give you any logs:npm run test:jest
to execute same test withjest
, you'll find that jest is able to tell you what went wrong:System Info
System: OS: macOS 12.3 CPU: (10) arm64 Apple M1 Max Memory: 169.31 MB / 64.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 16.18.1 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 8.19.2 - /usr/local/bin/npm Browsers: Chrome: 108.0.5359.124 Safari: 15.4 npmPackages: vitest: 0.26.3 => 0.26.3
Relevant Information
I am currently locating that the problem is that vitest will exit directly when the Worker process driving the test exits:
vitest/packages/vitest/src/node/pool.ts
Lines 141 to 143 in 1997767
Used Package Manager
pnpm
Validations
The text was updated successfully, but these errors were encountered: