Skip to content

Commit c73bd61

Browse files
committed
Merge pull request #53 from tarobomb/master
fix mocha-plugin for recent versions of Mocha
2 parents ab86ac8 + aa8dbc0 commit c73bd61

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

lib/_patch/mocha-plugin.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@
2020
return test.fullTitle().replace(/#/g, '');
2121
}
2222

23-
return Mocha.BrowserStack = function(runner, root) {
24-
Mocha.reporters.HTML.call(this, runner, root);
23+
var origReporter = mocha._reporter;
24+
25+
Mocha.BrowserStack = function(runner, root) {
26+
origReporter.apply(this, arguments);
2527

2628
var count = 1,
2729
that = this,
@@ -61,4 +63,8 @@
6163
BrowserStack.post("/_report", results, function(){});
6264
});
6365
};
66+
67+
Mocha.BrowserStack.prototype = origReporter.prototype;
68+
69+
return Mocha.BrowserStack;
6470
})();

lib/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ exports.Server = function Server(bsClient, workers) {
9595
patch += "<script type='text/javascript' src='/_patch/" + script + "'></script>\n";
9696
});
9797
}
98-
patch += "</body>";
98+
patch += "</head>";
9999

100100
file = file.replace(matcher, patch);
101101
}

0 commit comments

Comments
 (0)