Reproduction of vitest#2615.
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.
git clone https://github.com/ulivz/vitest-simply-exits-when-met-process-exit-repro
pnpm i
- Run
npm run test
, you will notice thatvitest
process will exit and not give you any logs:
- Run
npm run test:jest
to execute same test withjest
, you'll find that jest is able to tell you what went wrong:
I am currently locating that the problem is that vitest will exit directly when the Worker process driving the test exits: