Skip to content

Commit

Permalink
docs(configuration): add maxWorkers option documentation (#11276)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahnpnl committed Apr 8, 2021
1 parent 4926564 commit 5bf72ec
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/Configuration.md
Expand Up @@ -536,6 +536,12 @@ Default: `5`

A number limiting the number of tests that are allowed to run at the same time when using `test.concurrent`. Any test above this limit will be queued and executed once a slot is released.

### `maxWorkers` \[number | string]

Specifies the maximum number of workers the worker-pool will spawn for running tests. In single run mode, this defaults to the number of the cores available on your machine minus one for the main thread. In watch mode, this defaults to half of the available cores on your machine to ensure Jest is unobtrusive and does not grind your machine to a halt. It may be useful to adjust this in resource limited environments like CIs but the defaults should be adequate for most use-cases.

For environments with variable CPUs available, you can use percentage based configuration: `"maxWorkers": "50%"`

### `moduleDirectories` \[array<string>]

Default: `["node_modules"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-25.x/Configuration.md
Expand Up @@ -475,6 +475,12 @@ Default: `5`

A number limiting the number of tests that are allowed to run at the same time when using `test.concurrent`. Any test above this limit will be queued and executed once a slot is released.

### `maxWorkers` \[number | string]

Specifies the maximum number of workers the worker-pool will spawn for running tests. In single run mode, this defaults to the number of the cores available on your machine minus one for the main thread. In watch mode, this defaults to half of the available cores on your machine to ensure Jest is unobtrusive and does not grind your machine to a halt. It may be useful to adjust this in resource limited environments like CIs but the defaults should be adequate for most use-cases.

For environments with variable CPUs available, you can use percentage based configuration: `"maxWorkers": "50%"`

### `moduleDirectories` \[array<string>]

Default: `["node_modules"]`
Expand Down
6 changes: 6 additions & 0 deletions website/versioned_docs/version-26.x/Configuration.md
Expand Up @@ -511,6 +511,12 @@ Default: `5`

A number limiting the number of tests that are allowed to run at the same time when using `test.concurrent`. Any test above this limit will be queued and executed once a slot is released.

### `maxWorkers` \[number | string]

Specifies the maximum number of workers the worker-pool will spawn for running tests. In single run mode, this defaults to the number of the cores available on your machine minus one for the main thread. In watch mode, this defaults to half of the available cores on your machine to ensure Jest is unobtrusive and does not grind your machine to a halt. It may be useful to adjust this in resource limited environments like CIs but the defaults should be adequate for most use-cases.

For environments with variable CPUs available, you can use percentage based configuration: `"maxWorkers": "50%"`

### `moduleDirectories` \[array<string>]

Default: `["node_modules"]`
Expand Down

0 comments on commit 5bf72ec

Please sign in to comment.