mock-promises
Advanced tools
Comparing version 0.1.2 to 0.1.3
@@ -17,2 +17,6 @@ (function() { | ||
var isFunction = function(obj) { | ||
return typeof obj == 'function' || false; | ||
}; | ||
var MockPromise, OriginalPromise, originalThen; | ||
@@ -170,5 +174,11 @@ | ||
function resolvePromise(promise, value) { | ||
promise.isFulfilled = function(){return true;}; | ||
promise.isRejected = function(){return false;}; | ||
promise.inspect = function() {return {value: value};} | ||
if(isFunction(value.then)) { | ||
extend(promise, value); | ||
} else { | ||
extend(promise, { | ||
isFulfilled: function(){return true;}, | ||
isRejected: function(){return false;}, | ||
inspect: function() {return {value: value};} | ||
}); | ||
} | ||
} | ||
@@ -175,0 +185,0 @@ |
{ | ||
"name": "mock-promises", | ||
"version": "0.1.2", | ||
"version": "0.1.3", | ||
"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
18688
282