Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Print test results on stdout instead of stderr.

Allows capturing test results to a file.
Rapid status line changes occur on stderr instead.
  • Loading branch information...
commit b338f055ca258cb5dba48d71e84d3b8dea298d3c 1 parent b6c58d0
@reid reid authored
Showing with 16 additions and 16 deletions.
  1. +16 −16 lib/cli.js
View
32 lib/cli.js
@@ -110,13 +110,13 @@ function submitBatch(client, options, cb) {
if ("fail" === test.result) {
if (!lastSuite || lastSuite !== suite.name) {
- error(" in", color.bold(suite.name));
+ puts(" in", color.bold(suite.name));
lastSuite = suite.name;
}
msg = test.message.split("\n");
- error(" ", color.bold(color.red(test.name)) + ":", msg[0]);
+ puts(" ", color.bold(color.red(test.name)) + ":", msg[0]);
for (m = 1; m < msg.length; m = m + 1) {
- error(" " + msg[m]);
+ puts(" " + msg[m]);
}
}
},
@@ -137,7 +137,7 @@ function submitBatch(client, options, cb) {
for (k in result) {
suite = result[k];
- if ("object" === typeof suite) {
+ if (suite && "object" === typeof suite) {
if (suite.failed) {
for (k1 in suite) {
test = suite[k1];
@@ -152,7 +152,7 @@ function submitBatch(client, options, cb) {
}
}
}
- error("");
+ puts("");
}
function coverageProgress() {
@@ -218,25 +218,25 @@ function submitBatch(client, options, cb) {
}
if (failed) {
- error(iconColor(icon), color.bold(details.name), "on", agent);
+ puts(iconColor(icon), color.bold(details.name), "on", agent);
displayVerboseResult(details);
}
});
batch.on("agentScriptError", function (agent, details) {
- error(color.red(bad + " Script error") + ": " + details.message);
- error(" URL: " + details.url);
- error(" Line: " + details.line);
- error(" User-Agent: " + agent);
+ puts(color.red(bad + " Script error") + ": " + details.message);
+ puts(" URL: " + details.url);
+ puts(" Line: " + details.line);
+ puts(" User-Agent: " + agent);
});
batch.on("agentError", function (agent, details) {
- error(color.red(bad + " Error") + ": " + details.message);
- error(" User-Agent: " + agent);
+ puts(color.red(bad + " Error") + ": " + details.message);
+ puts(" User-Agent: " + agent);
});
batch.on("agentComplete", function (agent) {
- error(good, "Agent completed:", agent);
+ puts(good, "Agent completed:", agent);
});
batch.on("agentProgress", function (agent, details) {
@@ -252,7 +252,7 @@ function submitBatch(client, options, cb) {
if (!agents.length) {
panic(bad, "No browsers connected, exiting.");
}
- error(good, "Testing started on", agents.join(", "));
+ puts(good, "Testing started on", agents.join(", "));
batchDetails.total *= agents.length;
});
@@ -263,11 +263,11 @@ function submitBatch(client, options, cb) {
durationString = "(" + duration + "ms)";
if (batchDetails.failed) {
- error(color.red("Failures") + ":", batchDetails.failed,
+ puts(color.red("Failures") + ":", batchDetails.failed,
"of", total, "tests failed.", durationString);
process.exit(1);
} else {
- error(color.green(total + " tests passed!"), durationString);
+ puts(color.green(total + " tests passed!"), durationString);
process.exit(0);
}
});
Please sign in to comment.
Something went wrong with that request. Please try again.