From f8872064cce4357a5ba502b2a63789d1057b6263 Mon Sep 17 00:00:00 2001 From: cloudhead Date: Sun, 16 May 2010 01:13:24 -0400 Subject: [PATCH] (fix) output the subjects without need for nextTick --- lib/vows.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/vows.js b/lib/vows.js index 5066261..6661591 100644 --- a/lib/vows.js +++ b/lib/vows.js @@ -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); } } @@ -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') {