Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Added a flag (-R, --rejections) to make the test fail if an unhandled Promise rejection happened during its execution #658
I'm open to suggestions, specially about naming.
All the relevant discussion is on the #649 issue. To sum up, I've added a flag to Lab, called
Without this flag, the behaviour will be exactly the same as before: The test pass, and in versions of Node.JS
An unhandled Promise rejection looks like this:
Initially, the behaviour of unhandled rejections was to be silenced and totally ignored, by design. It looks like everyone is changing their minds, because in the latest versions of Chrome and Node.JS (maybe more engines, I don't know more examples) the unhandled rejections have started to display console warnings. In 99% an unhandled rejection means that something is terribly bad with the code, and the fact that doesn't crash the entire process is just a questionable design choice. So I think it should definitely make a test fail.
Ouch. I've added tests to cover this feature in
Do you have any suggestion on how to handle this? I thought about adding tests to