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?
The Jest philosophy is to work great by default, but sometimes you just need more configuration power. It is recommended to define the configuration in a dedicated JavaScript, TypeScript or JSON file. The file will be discovered automatically, if it is named jest.config.js|ts|mjs|cjs|json .
The jest. config. js file is used for configuring Jest, the JavaScript testing library used for writing unit and integration tests in Pup. The modulePaths property tells Jest where it can resolve NPM modules used inside of the code you're testing.
The pattern Jest uses to detect test files. By default it looks for . js and . jsx files inside of __tests__ folders, as well as any files with a suffix of .
rootDir [string] Default: The root of the directory containing the package.json or the pwd if no package.json is found. Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
Using [email protected]
, 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%",
// ...
};
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With