mardi 7 mars 2017

Jest: Difference betwen --runInBand and --maxWorkers 1

When is it appropriate to use each of --runInBand or --maxWorkers 1 options?

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


Extra detail:

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

Here's the Jest CLI reference:

http://ift.tt/2n7T5Vh

Relevant parts:

--maxWorkers=<num>

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.

--runInBand

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.

Aucun commentaire:

Enregistrer un commentaire