run result - passed green, failed red

This commit is contained in:
Steve Conover
2011-02-28 15:13:46 -08:00
parent e6a080039f
commit e8c8a0bdfd
2 changed files with 43 additions and 6 deletions

View File

@@ -15,11 +15,16 @@ jasmine.TrivialNodeReporter = function(sys) {
function redStr(str) { return coloredStr("red", str); }
function yellowStr(str) { return coloredStr("yellow", str); }
function newline() { sys.print("\n"); }
function started() { sys.print("Started"); newline(); }
function greenDot() { sys.print(greenStr(".")); }
function redF() { sys.print(redStr("F")); }
function yellowStar() { sys.print(yellowStr("*")); }
function newline() { sys.print("\n"); }
function started() { sys.print("Started"); newline(); }
function greenDot() { sys.print(greenStr(".")); }
function redF() { sys.print(redStr("F")); }
function yellowStar() { sys.print(yellowStr("*")); }
function finished(colorF) { newline(); sys.print(colorF("Finished")); }
function greenFinished() { finished(greenStr); }
function redFinished() { finished(redStr); }
@@ -52,4 +57,12 @@ jasmine.TrivialNodeReporter = function(sys) {
}
startNewLineIfNecessary();
};
this.reportRunnerResults = function(runner) {
if (runner.results().failedCount === 0) {
greenFinished();
} else {
redFinished();
}
};
};