Comparing version 0.0.0 to 0.0.1
@@ -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', |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
8939
7
1
49