Skip to content

Commit

Permalink
docs: rewrite mention of old --no-threads option (#4978)
Browse files Browse the repository at this point in the history
  • Loading branch information
AriPerkkio committed Jan 17, 2024
1 parent 21f5744 commit ba7ae53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/guide/features.md
Expand Up @@ -32,7 +32,9 @@ Out-of-the-box ES Module / TypeScript / JSX support / PostCSS

## Threads

Workers multi-threading via [Tinypool](https://github.com/tinylibs/tinypool) (a lightweight fork of [Piscina](https://github.com/piscinajs/piscina)), allowing tests to run simultaneously. Threads are enabled by default in Vitest, and can be disabled by passing `--no-threads` in the CLI.
By default Vitest runs tests in multiple threads using [`node:worker_threads`](https://nodejs.org/api/worker_threads.html) via [Tinypool](https://github.com/tinylibs/tinypool) (a lightweight fork of [Piscina](https://github.com/piscinajs/piscina)), allowing tests to run simultaneously. If your tests are running code that is not compatible with multi-threading, you can switch to [`--pool=forks`](/config/#pool-1-0-0) which runs tests in multiple processes using [`node:child_process`](https://nodejs.org/api/child_process.html) via Tinypool.

To run tests in a single thread or process, see [`poolOptions`](/config/#pooloptions-1-0-0).

Vitest also isolates each file's environment so env mutations in one file don't affect others. Isolation can be disabled by passing `--no-isolate` to the CLI (trading correctness for run performance).

Expand Down

0 comments on commit ba7ae53

Please sign in to comment.