jest-runner-concurrent0.1.1 • Public • Published
Jest's default runner uses a new
child_process (also known as a worker) for each test file. Although the max number of workers is configurable, running a lot of them is slow and consumes tons of memory and CPU.
jest-runner-concurrent runs your tests concurrently instead of in parallel, so you can run hundreds of tests quickly with only a few workers.
To take advantage of the performance gains, your tests:
- Must be asynchronous
- Share no state with another test
npm install --save-dev jest-runner-concurrent
There are a couple ways to enable the runner
// <project_root>/jest.config.jsmoduleexports =runner: 'jest-runner-concurrent'
There are also a few ways to configure the runner
- maxConcurrentTests - No max.
0is the same as no max
moduleexports =maxConcurrentTests: 100;