Jest maxWorkers option is not available in configuration file

Viewed 1764

After I read through the docs. It seems to not have the option to set maxWorkers within the configuration files. I need to specify it in the cli.

Is there something that I'm missing here?

1 Answers

Using jest@26.1.0, npx jest --init generates maxWorkers in jest.config.js. It's just not documented on the website.

// ...

module.exports = {
  // ...

  // The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
  // maxWorkers: "50%",

  // ...
};
Related