Skip to content

Commit

Permalink
use suite's reporter for errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed Jun 18, 2010
1 parent 833a2a0 commit cf3f4e2
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions bin/vows
Original file line number Diff line number Diff line change
Expand Up @@ -141,17 +141,17 @@ if (! options.watch) {
reporter.report = function (data) {
switch (data[0]) {
case 'subject':
_reporter.report(data);
break;
case 'vow':
case 'context':
case 'error':
_reporter.report(data);
break;
case 'end':
(options.verbose || _reporter.name === 'json') && _reporter.report(data);
break;
case 'finish':
options.verbose ? _reporter.print('\n') : _reporter.print(' ');
break;
}
};
reporter.reset = function () { _reporter.reset && _reporter.reset() };
Expand Down
6 changes: 3 additions & 3 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ process.addListener('exit', function () {

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

unFired.forEach(function (title) {
sys.puts(console.error({
s.reporter.report(['error', {
error: "not fired!",
context: title,
batch: b,
suite: s
}));
}]);
});

if (b.status === 'begin') {
Expand Down
2 changes: 1 addition & 1 deletion lib/vows/console.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,5 +80,5 @@ this.inspect = function inspect(val) {

this.error = function (obj) {
return '✗ ' + $('Errored ').red + '» '
+ $('' + $(obj.context).italic + ' ∙ ' + obj.error).red;
+ $('' + $(obj.context).italic + ' ∙ ') + $(obj.error).red;
};
2 changes: 1 addition & 1 deletion lib/vows/reporters/dot-matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ this.report = function (data, s) {
puts(console.result(event).join('\n'));
break;
case 'error':
sys.puts('\n* ' + stylize(event.error + ' in ', 'red') + event.suite.subject);
puts(console.error(event));
break;
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/vows/reporters/spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ this.report = function (data, s) {
puts(console.result(event).join('\n'));
break;
case 'error':
puts('\n * ' + stylize(event.error, 'red'));
puts(console.error(event));
break;
}
};
Expand Down
2 changes: 1 addition & 1 deletion lib/vows/reporters/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ this.report = function (data) {
}
break;
case 'error':
puts('\n\n * ' + stylize(event.error, 'red'));
puts(console.error(event));
break;
}
};
Expand Down

0 comments on commit cf3f4e2

Please sign in to comment.