jest-runner-concurrent
A concurrent runner for Jest
Last updated 3 years ago by kevlened .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install jest-runner-concurrent 
SYNC missed versions from official npm registry.

jest-runner-concurrent

A concurrent, drop-in replacement for Jest's default test runner

npm version

What

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.

Caveats

To take advantage of the performance gains, your tests:

  1. Must be asynchronous
  2. Share no state with another test

Install

npm install --save-dev jest-runner-concurrent

Enable

There are a couple ways to enable the runner

package.json

{
  "jest": {
    "runner": "jest-runner-concurrent"
  }
}

jest.config.js

// <project_root>/jest.config.js

module.exports = {
  runner: 'jest-runner-concurrent'
}

Configure

There are also a few ways to configure the runner

Defaults:

  • maxConcurrentTests - No max. 0 is the same as no max

package.json

{
  "jest-runner-concurrent": {
    "maxConcurrentTests": 100
  }
}

jest-runner-concurrent.config.js

module.exports = {
  maxConcurrentTests: 100
};

License

MIT

Current Tags

  • 0.1.1                                ...           latest (3 years ago)

3 Versions

  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
  • 0.0.1                                ...           3 years ago
Maintainers (1)
Downloads
Today 0
This Week 1
This Month 2
Last Day 1
Last Week 0
Last Month 1
Dependencies (5)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |