From 1414948acaeb0a3b39e77b78a0ea94725756142c Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Sun, 28 Feb 2016 23:49:32 -0800 Subject: [PATCH] =?UTF-8?q?[New]=20Skipped=20test=20blocks=20should=20outp?= =?UTF-8?q?ut=20a=20=E2=80=9CSKIP=E2=80=9D=20message.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/test.js | 3 +++ test/skip.js | 28 ++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/lib/test.js b/lib/test.js index 94a42a81..4dcc7f8b 100644 --- a/lib/test.js +++ b/lib/test.js @@ -67,6 +67,9 @@ function Test (name_, opts_, cb_) { } Test.prototype.run = function () { + if (this._skip) { + this.comment('SKIP ' + this.name); + } if (!this._cb || this._skip) { return this._end(); } diff --git a/test/skip.js b/test/skip.js index 7b23126c..73d97f20 100644 --- a/test/skip.js +++ b/test/skip.js @@ -1,6 +1,34 @@ var test = require('../'); var ran = 0; +var concat = require('concat-stream'); +var tap = require('tap'); + +tap.test('test SKIP comment', function (assert) { + assert.plan(1); + + var verify = function (output) { + assert.equal(output.toString('utf8'), [ + 'TAP version 13', + '# SKIP skipped', + '', + '1..0', + '# tests 0', + '# pass 0', + '', + '# ok', + '' + ].join('\n')); + }; + + var tapeTest = test.createHarness(); + tapeTest.createStream().pipe(concat(verify)); + tapeTest('skipped', { skip: true }, function (t) { + t.end(); + }); +}); + + test('do not skip this', { skip: false }, function(t) { t.pass('this should run'); ran ++;