npm

Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

mocha-stress

1.0.0 • Public • Published

Mocha Stress

Build Status

Stress-test inconsistent parts of your Mocha test suite to identify and correct flaky tests.

Installation

mocha-stress requires node.js >= 4.

# Install the package from npm 
$ npm install --save-dev mocha-stress
 
# Add this argument to your Mocha command-line arguments: 
$ jq .scripts package.json
{
  "test""mocha -r mocha-stress"
}
 
# Or to your ./test/mocha.opts file: 
$ cat ./test/mocha.opts
--require mocha-stress

Usage

To run a specific spec a fixed number of iterations:

it.stress(100, 'is failing sometimes for some reason??', function () {
  expect(Math.random()).to.be.below(0.5)
})

It can also be used on an entire describe suite:

describe.stress(100, 'inconsistent', function () {
  // ..
})

This implies .only().

Keywords

install

npm i mocha-stress

Downloadsweekly downloads

1,664

version

1.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability