When is it appropriate to use each of the --runInBand
or --maxWorkers 1
options?
If I intend to run all the tests sequentially (in turn, in order), which one is the right option?
Additional Information:
I use Jest to test the NodeJs express
application, with integration tests hitting HTTP endpoints through supertest
. This may not make any difference to the answer, just mentioning in case it matters.
Here is the Jest CLI link:
https://facebook.imtqy.com/jest/docs/cli.html
Relevant Parts:
--maxWorkers=<num>
Alias: -w. Specifies the maximum number of workers on which the work pool will be launched to run the tests. By default, this is the number of cores available on your computer. It may be useful to configure this in resource-limited environments such as CI, but the default should be sufficient for most use cases.
--runInBand
Alias: -i. Run all tests sequentially in the current process, and do not create a working pool of child processes that run tests. This can be useful for debugging.
source share