unexpected
unexpected copied to clipboard
Investigate using mocha.throwError
/**
* Function to allow assertion libraries to throw errors directly into mocha.
* This is useful when running tests in a browser because window.onerror will
* only receive the 'message' attribute of the Error.
*/
mocha.throwError = function(err) {
Mocha.utils.forEach(uncaughtExceptionHandlers, function (fn) {
fn(err);
});
throw err;
};
@sunesimonsen would you say this was actually replaced by all our error machinery, oathbreaker for sync workloads and returning promises in the case of async things?