sinon-stub-promise
Advanced tools
Comparing version 0.0.9 to 0.1.0
@@ -5,3 +5,3 @@ function buildThenable() { | ||
try { | ||
if (this.resolved) { | ||
if (this.resolved && !this.rejected) { | ||
var returned = onFulfill(this.resolveValue); | ||
@@ -86,2 +86,1 @@ | ||
} | ||
{ | ||
"name": "sinon-stub-promise", | ||
"version": "0.0.9", | ||
"version": "0.1.0", | ||
"description": "Synchronous Promise stubbing for Sinon.JS", | ||
@@ -5,0 +5,0 @@ "author": "Alex May <alex@substantial.com>", |
@@ -87,1 +87,5 @@ # sinon-stub-promise | ||
that will grow over time as we identify any short comings of this library. | ||
## To Do | ||
* Allow for chaining with `withArgs`. Ideally we could do things like `sinon.stub().withArgs(42).resolves('value')`. |
@@ -267,3 +267,21 @@ var sinon = require('sinon'); | ||
}); | ||
it('does not execute additional then blocks when an error is thrown', function(done) { | ||
promise.resolves(); | ||
var callCount = 0; | ||
promise() | ||
.then(function() { | ||
throw new Error('Stop the insanity'); | ||
}) | ||
.then(function() { | ||
callCount++; | ||
}) | ||
.catch(function(error) { | ||
expect(callCount).to.eql(0); | ||
expect(error.message).to.eql('Stop the insanity'); | ||
done(); | ||
}); | ||
}); | ||
}); | ||
}); |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
11804
296
91
1