From 8d04af425d1e614abb9f6272187391dbb8fb5f1e Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Sat, 19 Jul 2014 18:18:56 -0400 Subject: [PATCH] Comments should not make exit code incorrect. Fixes #92 --- index.js | 2 +- test/exit.js | 1 + test/exit/ok.js | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index a44daf9a..0725efd3 100644 --- a/index.js +++ b/index.js @@ -110,7 +110,7 @@ function createHarness (conf_) { inspectCode(st_); }); st.on('result', function (r) { - if (!r.ok) test._exitCode = 1 + if (!r.ok && typeof r !== 'string') test._exitCode = 1 }); })(t); diff --git a/test/exit.js b/test/exit.js index 7f7c5d01..8055e5e6 100644 --- a/test/exit.js +++ b/test/exit.js @@ -18,6 +18,7 @@ tap.test('exit ok', function (t) { t.same(rs, [ 'TAP version 13', 'array', + 'hi', { id: 1, ok: true, name: 'should be equivalent' }, { id: 2, ok: true, name: 'should be equivalent' }, { id: 3, ok: true, name: 'should be equivalent' }, diff --git a/test/exit/ok.js b/test/exit/ok.js index a02c7b69..f1068e57 100644 --- a/test/exit/ok.js +++ b/test/exit/ok.js @@ -2,6 +2,7 @@ var falafel = require('falafel'); var test = require('../../'); test('array', function (t) { + t.comment('hi'); t.plan(5); var src = '(' + function () {