Jest maxWorkers选项在配置文件中不可用

lig*_*ger 8 jestjs

在我阅读了文档之后.它似乎没有maxWorkers在配置文件中设置的选项.我需要在cli中指定它.

这里有什么我想念的吗?

Dan*_*l T 3

使用jest@26.1.0,npx jest --init生成.maxWorkersjest.config.js只是网站上没有记录。

// ...

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%",

  // ...
};
Run Code Online (Sandbox Code Playgroud)