Jest: Difference betwen --runInBand and --maxWorkers 1 : <p>When is it appropriate to use each of <code>--runInBand</code> or <code>--maxWorkers 1</code> options?</p>

<p>If my intent is to run all tests in sequence (one at a time, in order), which of these is the right option?</p>

<hr>

<p>Extra detail:</p>

<p>I'm using Jest to test a NodeJs <code>express</code> application, with integration tests hitting the HTTP endpoints via <code>supertest</code>. This may not make any difference to the answer, just mentioning in case it is relevant.</p>

<p>Here's the Jest CLI reference: </p>

<p><a href="https://facebook.github.io/jest/docs/cli.html" rel="noreferrer">https://facebook.github.io/jest/docs/cli.html</a></p>

<p>Relevant parts:</p>

<p><code>--maxWorkers=&lt;num&gt;</code></p>

<p>Alias: -w. Specifies the maximum number of workers the worker-pool will spawn for running tests. This defaults to the number of the cores available on your machine. It may be useful to adjust this in resource limited environments like CIs but the default should be adequate for most use-cases.</p>

<p><code>--runInBand</code></p>

<p>Alias: -i. Run all tests serially in the current process, rather than creating a worker pool of child processes that run tests. This can be useful for debugging.</p>
