unexpected icon indicating copy to clipboard operation
unexpected copied to clipboard

Investigate using mocha.throwError

Open sunesimonsen opened this issue 10 years ago • 1 comments

/**
 * 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 avatar Jan 07 '15 15:01 sunesimonsen

@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?

alexjeffburke avatar Dec 11 '19 18:12 alexjeffburke