From c347a5d305823019375ca7975c1e438d2dad7627 Mon Sep 17 00:00:00 2001 From: Ram Damera Date: Mon, 24 Jun 2019 22:52:56 +0530 Subject: [PATCH] [Core] Remove todo and skip explanation options --- lib/results.js | 4 +-- test/objectMode.js | 8 +++--- test/todo_explanation.js | 58 ---------------------------------------- 3 files changed, 6 insertions(+), 64 deletions(-) delete mode 100644 test/todo_explanation.js diff --git a/lib/results.js b/lib/results.js index f8c714e5..f7e01675 100644 --- a/lib/results.js +++ b/lib/results.js @@ -144,8 +144,8 @@ function encodeResult(res, count) { output += (res.ok ? 'ok ' : 'not ok ') + count; output += res.name ? ' ' + res.name.toString().replace(/\s+/g, ' ') : ''; - if (res.skip) output += ' # SKIP' + (typeof res.skip === 'string' ? ' ' + res.skip : ''); - else if (res.todo) output += ' # TODO' + (typeof res.todo === 'string' ? ' ' + res.todo : ''); + if (res.skip) output += ' # SKIP'; + else if (res.todo) output += ' # TODO'; output += '\n'; if (res.ok) return output; diff --git a/test/objectMode.js b/test/objectMode.js index 5e1f3570..d9e1f6eb 100644 --- a/test/objectMode.js +++ b/test/objectMode.js @@ -17,7 +17,7 @@ tap.test('object results', function (assert) { var todos = 0; var skips = 0; var testIds = []; - var endIds = [] + var endIds = []; var asserts = 0; assert.equal(objects.length, 13); @@ -52,17 +52,17 @@ tap.test('object results', function (assert) { tape('parent', function (t1) { t1.equal(true, true); - t1.test('child1', {skip: 'not installed'}, function (t2) { + t1.test('child1', {skip: true}, function (t2) { t2.equal(true, true); t2.equal(true, false); t2.end(); }); - t1.test('child2', {todo: 'will get done soon'}, function (t3) { + t1.test('child2', {todo: true}, function (t3) { t3.equal(true, false); t3.equal(true, true); t3.end(); }); - t1.test('child3', {todo: 'will do'}); + t1.test('child3', {todo: true}); t1.equal(true, true); t1.equal(true, true); t1.end(); diff --git a/test/todo_explanation.js b/test/todo_explanation.js deleted file mode 100644 index 901c56a2..00000000 --- a/test/todo_explanation.js +++ /dev/null @@ -1,58 +0,0 @@ -var tap = require('tap'); -var tape = require('../'); -var concat = require('concat-stream'); - -var common = require('./common'); -var stripFullStack = common.stripFullStack; - -tap.test('tape todo test', function (assert) { - var test = tape.createHarness({ exit: false }); - assert.plan(1); - - test.createStream().pipe(concat(function (body) { - assert.equal( - stripFullStack(body.toString('utf8')), - 'TAP version 13\n' - + '# success\n' - + 'ok 1 this test runs\n' - + '# TODO incomplete test1\n' - + 'not ok 2 needs insight # TODO\n' - + ' ---\n' - + ' operator: fail\n' - + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)\n' - + ' ...\n' - + '# TODO incomplete test2\n' - + 'not ok 3 check description # TODO incomplete sentiment\n' - + ' ---\n' - + ' operator: fail\n' - + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)\n' - + ' ...\n' - + '# TODO passing test\n' - + '\n' - + '1..3\n' - + '# tests 3\n' - + '# pass 3\n' - + '\n' - + '# ok\n' - ) - })); - - test('success', function (t) { - t.equal(true, true, 'this test runs'); - t.end(); - }); - - test('incomplete test1', { todo: true }, function (t) { - t.fail('needs insight'); - t.end(); - }); - - test('incomplete test2', { todo: 'incomplete sentiment' }, function (t) { - t.fail('check description'); - t.end(); - }); - - test('passing test', { todo: 'yet incomplete' }, function (t) { - t.end(); - }); -});