Testing · Senior · Question 28 of 75
What is the trade-off between Vitest pools threads and forks?
- ✓Correct answer: Threads (worker_threads) are lighter; forks (child processes) are more compatible with native modules and process-level APIs
- 2Threads run in the browser, forks in Node.js
- 3There is no difference
Explanation
Vitest uses forks by default because some libraries break inside worker threads (e.g. segfaults with native addons).