diff --git a/example/test.js b/example/test.js index f3f012c..ac7eb31 100644 --- a/example/test.js +++ b/example/test.js @@ -4,7 +4,7 @@ function getMessage () { return msgs[Math.floor(Math.random() * msgs.length)]; } -test('beep', function (t) { +test('beep affirmative', function (t) { t.plan(24); var i = 0, n = 0; var iv = setInterval(function () { @@ -13,11 +13,15 @@ test('beep', function (t) { }, 50); }); -test('boop', function (t) { +test('boop exterminate', function (t) { t.plan(20); var i = 0, n = 0; var iv = setInterval(function () { - t.equal(i++, n++, getMessage()); + if (i % 7 === 0) { + t.equal(i, n + 6, getMessage()) + } + else t.equal(i, n, getMessage()); + i++; n++; if (i === 20) clearInterval(iv); }, 100); }); diff --git a/index.js b/index.js index b7aecf6..1f825e9 100644 --- a/index.js +++ b/index.js @@ -23,12 +23,13 @@ module.exports = function (opts) { tap.on('comment', function (comment) { test = { name: comment, assertions: [] }; - out.push(replaceLine(comment) + '\n'); + out.push(replaceLine('# ' + comment) + '\n'); }); tap.on('assert', function (res) { var ok = res.ok ? ' ok' : ' not ok'; - var fmt = '%s %3d %s'; + var fmt = '%s %2d %s'; + if (!res.ok) fmt += '\n'; var str = sprintf(fmt, ok, res.number, res.name); out.push(replaceLine(str)); test.assertions.push(res);