Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Socket
Sign inDemoInstall

stubborn

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

stubborn - npm Package Compare versions

Comparing version 0.0.0 to 0.0.1

CHANGELOG.md

6

lib/Stubborn.js

@@ -20,4 +20,4 @@ var _ = require('lodash');

}
var maxAttemps = options.maxAttemps;
this._maxAttemps = _.isUndefined(maxAttemps) ? 10 : maxAttemps;
var maxAttempts = options.maxAttempts;
this._maxAttempts = _.isUndefined(maxAttempts) ? 10 : maxAttempts;
var delay = options.delay;

@@ -58,3 +58,3 @@ this._delay = _.isUndefined(delay) ? 100 : delay;

var attempt = this._attempt;
if (attempt >= this._maxAttemps) {
if (attempt >= this._maxAttempts) {
var err = new Error('Max attempts reached');

@@ -61,0 +61,0 @@ this._callback(err);

{
"name": "stubborn",
"version": "0.0.0",
"version": "0.0.1",
"description": "Retry engine",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -16,3 +16,3 @@ var _ = require('lodash');

var testOptions = {
maxAttemps: 'testMaxAttemps',
maxAttempts: 'testMaxAttempts',
delay: 'testDelay',

@@ -28,3 +28,3 @@ delayProgression: 'testDelayProgression'

assert.strictEqual(stubbon._callback, 'testCallback');
assert.strictEqual(stubbon._maxAttemps, 'testMaxAttemps');
assert.strictEqual(stubbon._maxAttempts, 'testMaxAttempts');
assert.strictEqual(stubbon._delay, 'testDelay');

@@ -48,3 +48,3 @@ assert.strictEqual(stubbon._delayProgression, 'testDelayProgression');

assert.strictEqual(stubbon._callback, testCallback);
assert.strictEqual(stubbon._maxAttemps, 10);
assert.strictEqual(stubbon._maxAttempts, 10);
assert.strictEqual(stubbon._delay, 100);

@@ -194,3 +194,3 @@ assert.isUndefined(stubbon._delayProgression);

it('_onTaskExecuted with an error and max attemps reached', function() {
it('_onTaskExecuted with an error and max attempts reached', function() {

@@ -207,3 +207,3 @@ var mockEmitCallCount = 0;

emit: function(type, error) {
assert.strictEqual(type, 'error');
assert.strictEqual(type, 'error')
assert.strictEqual(error, 'testError');

@@ -215,3 +215,3 @@ mockEmitCallCount++;

_maxAttemps: 1,
_maxAttempts: 1,

@@ -223,3 +223,2 @@ _callback: function(err) {

}
};

@@ -234,3 +233,3 @@

it('_onTaskExecuted with an error and max attemps is not reached', function() {
it('_onTaskExecuted with an error and max attempts is not reached', function() {

@@ -258,3 +257,3 @@ var mockEmitCallCount = 0;

_maxAttemps: 1,
_maxAttempts: 1,

@@ -261,0 +260,0 @@ _delay: 'testDelay',

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