mock-promises
Advanced tools
Comparing version 0.6.1 to 0.6.2
@@ -293,3 +293,3 @@ (function (root, factory) { | ||
each(contractsTracker.forPromise(promise), function(contract) { | ||
contractsTracker.add(extend(contract, {promise: value})); | ||
contractsTracker.addIfUnique(extend(contract, {promise: value})); | ||
}); | ||
@@ -363,2 +363,14 @@ } | ||
this.addIfUnique = function(options) { | ||
var dupe = false; | ||
each(this.forPromise(options.promise), function(contract) { | ||
if(contract.thenPromise === options.thenPromise) { | ||
dupe = true; | ||
} | ||
}); | ||
if(dupe) return; | ||
return this.add(options); | ||
}; | ||
this.all = function() { | ||
@@ -365,0 +377,0 @@ return contracts; |
{ | ||
"name": "mock-promises", | ||
"version": "0.6.1", | ||
"version": "0.6.2", | ||
"author": "Charles Hansen <chansen87@gmail.com>", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
40415
829