-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add isCancelled() regression tests #1239
add isCancelled() regression tests #1239
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me generally
}); | ||
|
||
specify("isCancelled() synchronously returns true after calling cancel() on pending promise", function() { | ||
var resolver = Promise.pending(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not use Promise.pending
in new tests?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm happy to clean this up. What should it be replaced with?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think new Promise(function(){})
works fine.
}); | ||
|
||
specify("isCancelled() synchronously returns true after calling cancel() on promise created from .then()", function() { | ||
var resolver = Promise.pending(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same, let's not use Promise.pending in new tests
Feedback addressed. |
@benjamingr Does this look ok to merge? |
@benjamingr @petkaantonov ping :) |
Adding some regression tests around isCancelled(). These tests are green against bluebird master:
In our fork of bluebird, we moved over from bluebird2 to bluebird3 a few months ago so we're on a slightly older version of bluebird still. We have some issues with this version around cancellation, and the second unit test here isolates one of these issues - it fails in our fork:
Looks like we can merge the latest release of bluebird to fix the issue on our side. Adding these tests to protect this behavior.