Skip to content

Commit

Permalink
log errors if they escape us
Browse files Browse the repository at this point in the history
  • Loading branch information
dignifiedquire committed Aug 16, 2017
1 parent 62aa780 commit ee483bf
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/jest-jasmine2/src/jasmine/Env.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,18 +188,13 @@ module.exports = function(j$) {
}

const uncaught = err => {
let name;
let current;
if (currentSpec) {
current = currentSpec;
name = current.getFullName();
current.onException(err);
current.cancel();
// TODO: how to cancel the current running spec
currentSpec.onException(err);
currentSpec.cancel();
} else {
// TODO: Handle top level failures
console.error('Unhandled error');
console.error(err.stack);
}
// console.error('caught in ' + name);
};

process.on('uncaughtException', uncaught);
Expand Down

0 comments on commit ee483bf

Please sign in to comment.