diff --git a/lib/UnexpectedError.js b/lib/UnexpectedError.js index 626079eb3..72232a3f1 100644 --- a/lib/UnexpectedError.js +++ b/lib/UnexpectedError.js @@ -9,6 +9,8 @@ function UnexpectedError(expect, assertion, parent) { if (Error.captureStackTrace) { Error.captureStackTrace(this, UnexpectedError); } else { + // Throw the error to make sure it has its stack serialized: + try { throw base; } catch (err) {} this.stack = base.stack; }