Skip to content

Commit

Permalink
docs: add clarification about threads option (#1247)
Browse files Browse the repository at this point in the history
  • Loading branch information
sheremet-va committed May 6, 2022
1 parent 70bc30b commit 2fcba95
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/config/index.md
Expand Up @@ -243,6 +243,12 @@ By providing an object instead of a string you can define individual outputs whe

Enable multi-threading using [tinypool](https://github.com/Aslemammad/tinypool) (a lightweight fork of [Piscina](https://github.com/piscinajs/piscina))

:::warning
This option is different from Jest's `--runInBand`. Vitest uses workers not only for running tests in parallel, but also to provide isolation. By disabling this option, your tests will run sequentially, but in the same global context, so you must provide isolation yourself.

This might cause all sorts of issues, if you are relying on global state (frontend frameworks usually do) or your code relies on environment to be defined separately for each test (like, `@vue/test-utils`). But can be a speed boost for Node tests (up to 3 times faster), that don't necessarily rely on global state or can easily bypass that.
:::

### maxThreads

- **Type:** `number`
Expand Down

0 comments on commit 2fcba95

Please sign in to comment.