Skip to content

armgit / mocha

Public Imported from GitHub
0

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

safari you suck

Tj Holowaychuk4d8a1b1df4d7
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index e33bcb26..201fca7d 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -71,7 +71,8 @@ function HTML(runner) {
var el = $('<div class="test pass"><h2>' + test.title + '</h2></div>')
} else {
var el = $('<div class="test fail"><h2>' + test.title + '</h2></div>');
- var err = $('<pre class="error">' + test.err.stack + '</pre>');
+ var str = test.err.stack || test.err;
+ var err = $('<pre class="error">' + str + '</pre>');
el.append(err);
}
diff --git a/mocha.js b/mocha.js
index eab2eed3..4225ddb7 100644
--- a/mocha.js
+++ b/mocha.js
@@ -812,7 +812,8 @@ function HTML(runner) {
var el = $('<div class="test pass"><h2>' + test.title + '</h2></div>')
} else {
var el = $('<div class="test fail"><h2>' + test.title + '</h2></div>');
- var err = $('<pre class="error">' + test.err.stack + '</pre>');
+ var str = test.err.stack || test.err;
+ var err = $('<pre class="error">' + str + '</pre>');
el.append(err);
}