maxConcurrency
- Type:
number - Default:
5 - CLI:
--maxConcurrency=10
Limit the number of test cases running at the same time within a test file when using test.concurrent or describe.concurrent. Cases above the limit wait until a slot is released.
With sequence.hooks: 'parallel', this value also limits concurrent lifecycle hooks and returned cleanup functions within a file. Hooks use a separate limit from concurrent test cases.
Increasing this value does not make ordinary test() cases concurrent. Mark the tests or their suite as concurrent to opt in.
For example, pool.maxWorkers: 1 runs Node.js test files one at a time, but each file can still run multiple test.concurrent cases. Set maxConcurrency: 1 as well if those cases must also run one at a time.