Permalink
Browse files

Do not print the XML preamble until dispatch.

Prevents the preamble from being written when no browsers
are connected.
  • Loading branch information...
1 parent 6d7c46f commit a183efc00110268202d599251f294487541c3b39 @reid reid committed Feb 28, 2014
Showing with 4 additions and 2 deletions.
  1. +4 −2 lib/cli/reporter/junit.js
@@ -27,8 +27,6 @@ function JUnitReporter(options) {
this.complete = false;
this.hasFailures = false;
-
- this.putsPreamble();
}
util.inherits(JUnitReporter, Reporter);
@@ -80,6 +78,10 @@ JUnitReporter.prototype.putsPreamble = function () {
this.cli.puts('<testsuites>');
};
+JUnitReporter.prototype.handleDispatch = function (agents) {
+ this.putsPreamble();
+};
+
// Convert milliseconds to seconds.
function getTime(ms) {
ms = Number(ms);

0 comments on commit a183efc

Please sign in to comment.