Calling cancel more than once synchronously causes weird behavior #362
Closed
Description
Adding the following tests to test/mocha/cancel.js
demonstrates this behavior. With delay
passes while Without delay
fails.
describe("Cancelling a promise twice should have no additional effect", function() {
specify("With delay", function(done) {
var promise = pending().promise.cancellable().catch(function(){}).then(done).catch(function() { done(new Error('Should not be called')) });
promise.cancel();
setTimeout(function() {
promise.cancel();
}, 50);
});
specify("Without delay", function(done) {
var promise = pending().promise.cancellable().catch(function(){}).then(done).catch(function() { done(new Error('Should not be called')) });
promise.cancel()
promise.cancel();
});
});
Metadata
Assignees
Labels
No labels