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

Throw a descriptive error when a non-function is given to a runnable #4133

Merged
merged 1 commit into from
Jan 19, 2020

Commits on Jan 10, 2020

  1. Throw a descriptive error when a non-function is given to a runnable

    Given a test such as:
    
    ```js
    it('foobars', 4);
    ```
    
    mocha used to throw the following error: `fn.call is not a function`.
    
    While technically true, I have personally spent some minutes of my life chasing
    what looked like a bug in the test itself, and not in the call to `it`. A more
    descriptive error message helps bring attention to where the problem originates.
    
    (Thanks to [ssube](https://github.com/ssube) for helping with the error wording.)
    Zirak committed Jan 10, 2020
    Configuration menu
    Copy the full SHA
    7f649bd View commit details
    Browse the repository at this point in the history