Skip to content

Commit ec78f7d

Browse files
log errors if they escape us
1 parent ec53f1a commit ec78f7d

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

  • packages/jest-jasmine2/src/jasmine

packages/jest-jasmine2/src/jasmine/Env.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -188,18 +188,13 @@ module.exports = function(j$) {
188188
}
189189

190190
const uncaught = err => {
191-
let name;
192-
let current;
193191
if (currentSpec) {
194-
current = currentSpec;
195-
name = current.getFullName();
196-
current.onException(err);
197-
current.cancel();
198-
// TODO: how to cancel the current running spec
192+
currentSpec.onException(err);
193+
currentSpec.cancel();
199194
} else {
200-
// TODO: Handle top level failures
195+
console.error('Unhandled error');
196+
console.error(err.stack);
201197
}
202-
// console.error('caught in ' + name);
203198
};
204199

205200
process.on('uncaughtException', uncaught);

0 commit comments

Comments
 (0)