lib/parallel.js
function patchUncaught() {
  var name = 'uncaughtException';
  var originalListener = process.listeners(name).pop();

  if (originalListener) {
    process.removeListener(name, originalListener);
  }

  return function() {
    if (!originalListener) return;
    process.on(name, originalListener);
  };
}
function patchUncaught() {
  var name = 'uncaughtException';
  var originalListener = process.listeners(name).pop();

  if (originalListener) {
    process.removeListener(name, originalListener);
  }

  return function() {
    if (!originalListener) return;
    process.on(name, originalListener);
  };
}
function patchUncaught ( ) { var name = 'uncaughtException' ; var originalListener = process . listeners ( name ) . pop ( ) ; if ( originalListener ) { process . removeListener ( name , originalListener ) ; } return function ( ) { if ( ! originalListener ) return ; process . on ( name , originalListener ) ; } ; }
Removes mocha's uncaughtException handler, allowing exceptions to be handled
by domains during parallel spec execution, and all others to terminate the
process.

@returns {function} Function that restores mocha's uncaughtException listener
Removes mocha s uncaughtException handler allowing exceptions to be handled by domains during parallel spec execution and all others to terminate the process .