Skip to content

Commit

Permalink
improve async error report
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Feb 21, 2011
1 parent 332b522 commit 7874f54
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ process.on('exit', function () {

vows.suites.forEach(function (s) {
if ((s.results.total > 0) && (s.results.time === null)) {
s.reporter.print('\n\n');
s.reporter.report(['error', { error: "Asynchronous Error", suite: s }]);
}
s.batches.forEach(function (b) {
Expand All @@ -146,7 +147,7 @@ process.on('exit', function () {

unFired.forEach(function (title) {
s.reporter.report(['error', {
error: "not fired!",
error: "callback not fired",
context: title,
batch: b,
suite: s
Expand Down
9 changes: 7 additions & 2 deletions lib/vows/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ this.inspect = function inspect(val) {
};

this.error = function (obj) {
return '✗ ' + $('Errored ').red + '» ' + $(obj.suite.subject).bold + ': '
+ $('' + $(obj.context).italic + ' ∙ ') + $(obj.error).red;
var string = '✗ ' + $('Errored ').red + '» ';
string += $(obj.error).red.bold + '\n';
string += (obj.context ? ' in ' + $(obj.context).red + '\n': '');
string += ' in ' + $(obj.suite.subject).red + '\n';
string += ' in ' + $(obj.suite._filename).red;

return string;
};

0 comments on commit 7874f54

Please sign in to comment.