New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

jest-retries

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

jest-retries

Automatically retry flaky tests with Jest

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.8K
decreased by-0.16%
Maintainers
1
Weekly downloads
 
Created
Source

jest-retries

Tired of manually re-running your CI when flaky tests fail? Puppeteer fails sporadically? Envy your friends because they use jest-circus? No more!

What should I do?

npm i -D jest-retries
const retry = require('jest-retries');

retry('Do flaky work', 5, () => {
    expect(irregularFunction()).toBe('sporadic');
});

That's it!

No configurations, no arguments, just require jest-retries and use it instead of test().

Can I completely replace test with jest-retries?

You sure can!

const test = require('jest-retries');

function getRandomInt(min, max) {
    min = Math.ceil(min);
    max = Math.floor(max);
    return Math.floor(Math.random() * (max - min)) + min;
  }

test('Random value should eventually resolve to 1', 100, () => {
    expect(getRandomInt(0, 2)).toBe(1);
});

Contributions

Plesae feel free to ask for features by creating issues, or to implement features by creating pull requests. I'll do my best to review things as fast as I can, as I always try to do.

If you find any errors or strange behaviors, please report them by creating an issue.

License

This project is licensed under the MIT License.

Keywords

FAQs

Package last updated on 12 Jun 2019

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc