🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

itretry

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itretry

mocha it.retry()

latest
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

itretry

Retry individual mocha tests. Useful for e2e tests on sketchy connections.

import itretry from 'itretry';

it.retry = itretry;

let i = 0;

describe('something', function() {
    it.retry(5, 'retries until it succeeds', function() {
        i++;
        expect(i).to.equal(5);
    });
});

// something
//      âś“ retries the thing 5 times

works with async tests too

it.retry(5, 'tests something', function() {
    return Promise.resolve();
});

it.retry(9999, 'async with done', function(done) {
    set.timeout(() => {
        expect(Math.random()).to.be.below(.1);
        done();
    }, 100);
});

FAQs

Package last updated on 17 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