我读完文档后。似乎没有在配置文件中设置maxWorkers
的选项。我需要在cli中指定它。
这里有什么东西我不在吗?
答案 0 :(得分:0)
使用jest@26.1.0
,npx jest --init
在maxWorkers
中生成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%",
// ...
};