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

Ban mixing of promise and async APIs in it handler. #1735

Closed
wants to merge 1 commit into from

Conversation

metamatt
Copy link

@metamatt metamatt commented Jun 9, 2015

If the it handler accepts a done argument, it is using the async
API, and must not return a promise.

Closes #1734.

If the `it` handler accepts a `done` argument, it is using the async
API, and must not return a promise.

Closes mochajs#1734.
@@ -238,6 +238,9 @@ Runnable.prototype.run = function(fn){
}
done();
});
if (ret && typeof ret.then === 'function') {
done(new Error('runnable accepted "done" but returned promise'));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs different language.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about Supply a "done" parameter or return a Promise, but not both

@boneskull
Copy link
Member

@metamatt

  • rebase against v3.0.0
  • change wording of error
  • ensure this error also applies to hooks

then I think we're good to merge

@hollomancer
Copy link

This was handled in #1320, closing this out.

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.

None yet

3 participants