Skip to content

Commit

Permalink
(fix) output the subjects without need for nextTick
Browse files Browse the repository at this point in the history
  • Loading branch information
cloudhead committed May 16, 2010
1 parent 1cb886c commit f887206
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions lib/vows.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,10 @@ function addVows(tests) {

function puts() {
var args = Array.prototype.slice.call(arguments);
if (vows.promises[suites - 1].listeners('finish').length > 0) {
if (vows.promises.length && vows.promises[suites - 1].listeners('finish').length > 0) {
buffer.push(args.join('\n'));
} else {
sys.puts.apply(null, args);
sys.puts.apply(null, args);
}
}

Expand Down Expand Up @@ -388,11 +388,10 @@ vows.describe = function (subject) {
broken = 0, errored = 0;
buffer = [], suites = 0;

process.nextTick(function () {
if (!vows.options.brief) {
puts('\n' + stylize(subject, 'underline') + '\n');
}
});
if (!vows.options.brief) {
puts('\n' + stylize(subject, 'underline') + '\n');
}

return new(events.EventEmitter)().addListener('newListener', function (e, listener) {
var that = this;
if (e === 'end') {
Expand Down

0 comments on commit f887206

Please sign in to comment.