Socket
Book a DemoInstallSign in
Socket

mocha-eventually

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mocha-eventually

Retries a Mocha test until it works

latest
Source
npmnpm
Version
1.1.0
Version published
Weekly downloads
467
-7.52%
Maintainers
1
Weekly downloads
 
Created
Source

mocha-eventually

Retries a test until it eventually works.

Status

eventually(callback(next()), [timeout], [interval]) -> Promise

callback is a function. If it's async, it should either consume the next() parameter, or return a promise.

If it doesn't work within timeout milliseconds, it's considered a failure.

If a test fails and timeout has not ellapsed yet, it will wait interval milliseconds and try again.

Returns a promise, which Mocha will happily consume.

var eventually = require('mocha-eventually')

it('eventually works', function () {
  return eventually(function (next) {
    assert(Math.random() > 0.9)
  }, 2000)
})

Thanks

mocha-eventually © 2015+, Rico Sta. Cruz. Released under the MIT License.
Authored and maintained by Rico Sta. Cruz with help from contributors (list).

ricostacruz.com  ·  GitHub @rstacruz  ·  Twitter @rstacruz

FAQs

Package last updated on 19 Sep 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts