maxWorkers description uses the wrong percentage formula
Author: januththedevCreated Sep 26, 2026Updated Sep 26, 2026
Description
The maxWorkers description shipped in jest-config contradicts the implementation and the package's own test.
Evidence
packages/jest-config/src/Descriptions.ts says maxWorkers: '10%' uses “10% of your CPU amount + 1”. The implementation computes:
Math.max(Math.floor((parsed / 100) * numCpus), 1)There is no +1. getMaxWorkers.test.ts asserts that 50% on four CPUs equals two workers, while the shipped text would predict three.
The string is written into every scaffolded jest.config.js by create-jest, so the incorrect explanation reaches new users directly.
Expected
The description states the implemented floor-and-clamp formula.
Actual
It describes a different formula that overstates the worker count on larger machines.
I found no existing issue or PR for this description.
Source: jestjs/jest