Skip to content

armgit / mocha

Public Imported from GitHub
0

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

`str` should be a string. (Fixes html reports in Safari)

Tyson Tate36f06ace2217
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index 7c439e46..750c8112 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -99,7 +99,7 @@ function HTML(runner) {
var el = fragment('<div class="test pass pending"><h2>%e</h2></div>', test.title);
} else {
var el = fragment('<div class="test fail"><h2>%e</h2></div>', test.title);
- var str = test.err.stack || test.err;
+ var str = test.err.stack || test.err.toString();
// FF / Opera do not add the message
if (!~str.indexOf(test.err.message)) {