Skip to content

armgit / mocha

Public Imported from GitHub
0

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

misc

TJ Holowaychukc9cfde5f007a
diff --git a/lib/reporters/html.js b/lib/reporters/html.js
index 7d9825d6..7a9822e2 100644
--- a/lib/reporters/html.js
+++ b/lib/reporters/html.js
@@ -43,7 +43,8 @@ function HTML(runner) {
, stack = [root]
, stat = $(statsTemplate).appendTo(root)
, canvas = stat.find('canvas').get(0)
- , ctx, progress
+ , progress
+ , ctx
if (canvas.getContext) {
ctx = canvas.getContext('2d');
@@ -52,9 +53,7 @@ function HTML(runner) {
if (!root.length) return error('#mocha div missing, add it to your document');
- if (progress) {
- progress.size(50);
- }
+ if (progress) progress.size(50);
runner.on('suite', function(suite){
if (suite.root) return;
@@ -82,7 +81,6 @@ function HTML(runner) {
var percent = stats.tests / total * 100 | 0;
if (progress) {
- // update progress bar
progress.update(percent).draw(ctx);
}
@@ -103,9 +101,7 @@ function HTML(runner) {
// <=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;
- }
+ if ('[object Error]' == str) str = test.err.message;
var err = $('<pre class="error">' + str + '</pre>');
el.append(err);