Skip to content
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

Conversation

finnigantime
Copy link
Contributor

Adding some regression tests around isCancelled(). These tests are green against bluebird master:

screen shot 2016-09-19 at 8 09 39 am

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:

screen shot 2016-09-19 at 8 10 10 am

Looks like we can merge the latest release of bluebird to fix the issue on our side. Adding these tests to protect this behavior.

Copy link
Collaborator

@benjamingr benjamingr left a 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();
Copy link
Collaborator

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?

Copy link
Contributor Author

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?

Copy link
Collaborator

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();
Copy link
Collaborator

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

@finnigantime
Copy link
Contributor Author

Feedback addressed.

@finnigantime
Copy link
Contributor Author

@benjamingr Does this look ok to merge?

@finnigantime
Copy link
Contributor Author

@benjamingr @petkaantonov ping :)

@petkaantonov petkaantonov merged commit d9a3a62 into petkaantonov:master Jan 2, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants