From cd57d924bbb8d123f53a654c88e0c23ed08d677c Mon Sep 17 00:00:00 2001 From: Sammy Jelin Date: Mon, 21 Mar 2016 15:15:16 -0700 Subject: [PATCH] fix(stacktrace): don not crash if beforeEach block is rejected without any stated reason Closes #44 --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index d88d3ad..d29ce88 100644 --- a/index.js +++ b/index.js @@ -97,6 +97,10 @@ function wrapInControlFlow(globalFn, fnName) { } }, flow); }, 'Run ' + fnName + description + ' in control flow').then(seal(done), function(err) { + if (!err) { + err = new Error('Unknown Error'); + err.stack = ''; + } err.stack = err.stack + '\nFrom asynchronous test: \n' + driverError.stack; done.fail(err); });