Jest maxWorkers选项在配置文件

时间:2017-10-07 01:46:38

标签: jestjs

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

这里有什么东西我不在吗?

1 个答案:

答案 0 :(得分:0)

使用jest@26.1.0npx jest --initmaxWorkers中生成jest.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%",

  // ...
};
相关问题