sinon-stub-promise
Advanced tools
Comparing version 1.0.1 to 1.1.0
@@ -14,3 +14,5 @@ function buildThenable() { | ||
// update resolve value for next promise in chain | ||
this.resolveValue = returned; | ||
if (returned !== undefined) { | ||
this.resolveValue = returned; | ||
} | ||
@@ -17,0 +19,0 @@ return this; |
{ | ||
"name": "sinon-stub-promise", | ||
"version": "1.0.1", | ||
"version": "1.1.0", | ||
"description": "Synchronous Promise stubbing for Sinon.JS", | ||
@@ -5,0 +5,0 @@ "author": "Alex May <alex@substantial.com>", |
@@ -32,2 +32,17 @@ var sinon = require('sinon'); | ||
}); | ||
it('can resolve multiple times with the same value', function() { | ||
var secondResolvedValue = null; | ||
promise.resolves('resolve value'); | ||
promise().then(function(arg) { | ||
resolveValue = arg; | ||
}); | ||
expect(resolveValue).to.equal('resolve value'); | ||
promise().then(function(arg) { | ||
secondResolvedValue = arg; | ||
}); | ||
expect(secondResolvedValue).to.equal('resolve value'); | ||
}); | ||
@@ -34,0 +49,0 @@ it('can resolve empty value', function() { |
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
12606
310