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

Fail when test resolution method is overspecified #1320

Closed
wants to merge 1 commit into from

Commits on Aug 22, 2014

  1. Fail when test resolution method is overspecified

    Users may register `Runnable`s as asynchronous in one of two ways:
    
    - Via callback (by defining the body function to have an arity of one)
    - Via promise (by returning a Promise object from the body function)
    
    When both a callback function is specified *and* a Promise object is
    returned, the `Runnable`'s resolution condition is ambiguous.
    Practically speaking, users are most likely to make this mistake as they
    transition between asynchronous styles.
    
    Currently, Mocha silently prefers the callback amd ignores the Promise
    object. Update the implementation of the `Runnable` class to fail
    immediately when the test resolution method is over-specified in this
    way.
    jugglinmike committed Aug 22, 2014
    Configuration menu
    Copy the full SHA
    367fb9f View commit details
    Browse the repository at this point in the history