Skip to content

ulivz/vitest-simply-exits-when-met-process-exit-repro

Repository files navigation

vitest-simply-exits-when-met-process-exit-repro

Reproduction of vitest#2615.

Summary

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.

Step to reproduce

  1. git clone https://github.com/ulivz/vitest-simply-exits-when-met-process-exit-repro
  2. pnpm i
  3. Run npm run test, you will notice that vitest process will exit and not give you any logs:

  1. Run npm run test:jest to execute same test with jest, you'll find that jest is able to tell you what went wrong:

Relevant Information

I am currently locating that the problem is that vitest will exit directly when the Worker process driving the test exits:

https://github.com/vitest-dev/vitest/blob/199776767a10bcd9f241e36a5cdd578c7d7c0dc2/packages/vitest/src/node/pool.ts#L141-L143

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published