-
-
Notifications
You must be signed in to change notification settings - Fork 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
Test fail without reason + #2906 #2995
Comments
Strange thing if you remove describe like that
You obtain a different result with an uncaught promisse rejection
|
For the last one (it not encapsulated) this fail there: Line 576 in 2bc9c4d
Edit: It only fail when it is not in describe |
Hey @robininfo-edsx, I was initially trying to figure out that nested promise construction and |
@ScottFreeCode Seems to be that 👍 |
Hmm finally not sure it's only that as my test fail but shouldn't fail 😢 |
Maybe change from using the
I'm not sure what event emitters do when they have an error to emit and no "error" event handler has been attached, but if they throw an uncaught exception asynchronously in that case, that might be how the exception escapes your promise structure and ends up failing the Mocha test. It may also help to simplify the promise/async code. There's a pretty good article on how to do that here: https://pouchdb.com/2015/05/18/we-have-a-problem-with-promises.html It's not aimed at your particular case and it predates |
It's effectively that but well Node's documentation does mention that if an error event handler is not attached errors will be thrown (I was expecting that the function just failed quietly) |
OS: Linux (Ubuntu)
Node: v8.1.4
NPM: 5.4.0
Mocha: 3.5.0
How to reproduce:
Output of mocha:
The text was updated successfully, but these errors were encountered: