Permalink
Browse files

Add source line to html report for Safari.

  • Loading branch information...
1 parent 36f06ac commit d1debbad614b24d3faa052ee2aaddb966204b5d3 @tysonmote tysonmote committed with tj Mar 17, 2012
Showing with 5 additions and 0 deletions.
  1. +5 −0 lib/reporters/html.js
View
@@ -110,6 +110,11 @@ function HTML(runner) {
// check for the result of the stringifying.
if ('[object Error]' == str) str = test.err.message;
+ // Safari doesn't give you a stack. Let's at least provide a source line.
+ if (!test.err.stack && test.err.sourceURL && test.err.line !== undefined) {
+ str += "\n(" + test.err.sourceURL + ":" + test.err.line + ")";
+ }
+
el.appendChild(fragment('<pre class="error">%e</pre>', str));
}

0 comments on commit d1debba

Please sign in to comment.