Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

Fixed opera stack trace, add .message

TJ Holowaychuk13a88c7359f6
diff --git a/mocha.js b/mocha.js
index dcdd00e1..bf0c1d10 100644
--- a/mocha.js
+++ b/mocha.js
@@ -1355,6 +1355,9 @@ function HTML(runner) {
var el = $('<div class="test fail"><h2>' + escape(test.title) + '</h2></div>');
var str = test.err.stack || test.err;
+ // Opera omits the .message
+ if (test.err.stacktrace) str = test.err.message + '\n' + str;
+
// <=IE7 stringifies to [Object Error]. Since it can be overloaded, we
// check for the result of the stringifying.
if ('[object Error]' == str) str = test.err.message;