Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Deferred output of feature results and very basic reporter engine
Will make sure all results are displayed together when running multiple async features in parallel.
- Loading branch information
1 parent
1326bf5
commit b26104d
Showing
5 changed files
with
64 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
var ERROR_INDENT = ' '; | ||
var ReportableError = exports.ReportableError = function (error) { | ||
this.error = error; | ||
}; | ||
|
||
ReportableError.prototype = { | ||
toReport: function () { | ||
return ERROR_INDENT + (this.error.message || this.error); | ||
} | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
var ReportableString = exports.ReportableString = function (string) { | ||
this.string = string; | ||
}; | ||
|
||
ReportableString.prototype = { | ||
toReport: function () { | ||
return this.string; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
var sys = require('sys'); | ||
var Reporter = exports.Reporter = function () { | ||
this.reports = []; | ||
}; | ||
|
||
Reporter.prototype = { | ||
add: function (reportable) { | ||
this.reports.push(reportable.toReport()); | ||
}, | ||
show: function () { | ||
sys.puts(this.reports.join('\n')); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters