diff -Nru node-tape-4.9.1/bin/tape node-tape-4.11.0/bin/tape --- node-tape-4.9.1/bin/tape 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/bin/tape 2019-06-29 06:01:20.000000000 +0000 @@ -17,7 +17,7 @@ opts.require = [opts.require]; } -opts.require.forEach(function(module) { +opts.require.forEach(function (module) { if (module) { /* This check ensures we ignore `-r ""`, trailing `-r`, or * other silly things the user might (inadvertently) be doing. diff -Nru node-tape-4.9.1/debian/changelog node-tape-4.11.0/debian/changelog --- node-tape-4.9.1/debian/changelog 2018-06-24 21:33:23.000000000 +0000 +++ node-tape-4.11.0/debian/changelog 2020-12-16 14:17:26.000000000 +0000 @@ -1,3 +1,30 @@ +node-tape (4.11.0-1) unstable; urgency=medium + + * Team upload + + [ Utkarsh Gupta ] + * New upstream version 4.11.0 + * Update d/patches/* + * Switch install and test to pkg-js-tools + + [ lintian-brush ] + * Set upstream metadata fields: Bug-Database, Bug-Submit, Repository, + Repository-Browse. + * Update standards version to 4.5.0, no changes needed. + + [ Xavier Guimard ] + * Bump debhelper compatibility level to 13 + * Declare compliance with policy 4.5.1 + * Add "Rules-Requires-Root: no" + * Add debian/gbp.conf + * Use dh-sequence-nodejs + * Fix register path + * Update patches + * Ignore error tests: error strings may change + * Ignore test/exit.js: path changes with autopkgtest + + -- Xavier Guimard Wed, 16 Dec 2020 15:17:26 +0100 + node-tape (4.9.1-1) unstable; urgency=medium * New upstream version diff -Nru node-tape-4.9.1/debian/compat node-tape-4.11.0/debian/compat --- node-tape-4.9.1/debian/compat 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/compat 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -11 diff -Nru node-tape-4.9.1/debian/control node-tape-4.11.0/debian/control --- node-tape-4.9.1/debian/control 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/control 2020-12-16 13:54:56.000000000 +0000 @@ -1,50 +1,49 @@ Source: node-tape +Maintainer: Debian Javascript Maintainers +Uploaders: Bastien Roucariès , + Ross Gammon Section: javascript +Testsuite: autopkgtest-pkg-nodejs Priority: optional -Maintainer: Debian Javascript Maintainers -Uploaders: Bastien Roucariès , Ross Gammon -Build-Depends: - debhelper (>= 11) - , dpkg-dev (>= 1.17.14) - , dh-buildinfo - , nodejs (>= 4.7) - , node-falafel (>= 2.1.0) - , node-concat-stream (>= 1.5) - , node-tap (>= 8) - , node-js-yaml (>= 3.10.0) - , node-tap-parser (>= 3.0) +Build-Depends: debhelper-compat (= 13) + , dh-sequence-nodejs + , node-concat-stream + , node-deep-equal + , node-defined + , node-falafel , node-function-bind (>= 1.1.1) - , node-lodash-packages (>= 4.0) - , node-resolve (>= 1.4.0) , node-glob (>= 7.1.2) - , node-deep-equal (>= 1.0.1) - , node-resumer - , node-defined (>= 1.0.0) - , node-minimist (>= 1.2.0) - , node-through (>= 2.0) , node-inherits (>= 2.0.3) + , node-js-yaml (>= 3.10.0) + , node-lodash-packages + , node-minimist , node-object-inspect (>= 1.5.0) -Standards-Version: 4.1.4 -Homepage: https://github.com/substack/tape -Vcs-Git: https://salsa.debian.org/js-team/node-tape.git + , node-resolve (>= 1.4.0) + , node-resumer + , node-tap (>= 8) + , node-tap-parser + , node-through +Standards-Version: 4.5.1 Vcs-Browser: https://salsa.debian.org/js-team/node-tape +Vcs-Git: https://salsa.debian.org/js-team/node-tape.git +Homepage: https://github.com/substack/tape +Rules-Requires-Root: no Package: node-tape Architecture: all -Depends: - ${misc:Depends} - , nodejs (>= 4.7) +Depends: ${misc:Depends} + , node-deep-equal + , node-defined , node-function-bind (>= 1.1.1) - , node-lodash-packages (>= 4.0) - , node-resolve (>= 1.4.0) , node-glob (>= 7.1.2) - , node-deep-equal (>= 1.0.1) - , node-resumer - , node-defined (>= 1.0.0) - , node-minimist (>= 1.2.0) - , node-through (>= 2.0) , node-inherits (>= 2.0.3) + , node-lodash-packages + , node-minimist , node-object-inspect (>= 1.5.0) + , node-resolve (>= 1.4.0) + , node-resumer + , node-through + , nodejs (>= 4.7) Description: tap-producing test harness for node and browsers Tape is a tap-producing test harness for node and browsers requiring only a few line of code. It can be used for unit and integration testing. diff -Nru node-tape-4.9.1/debian/copyright node-tape-4.11.0/debian/copyright --- node-tape-4.9.1/debian/copyright 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/copyright 2020-12-16 13:54:56.000000000 +0000 @@ -4,11 +4,12 @@ Source: https://github.com/substack/tape Files: * -Copyright: 2012-2017 James Halliday (http://substack.net) +Copyright: 2012 James Halliday License: Expat Files: debian/* Copyright: 2017-2018 Bastien Roucariès + 2020 Xavier Guimard License: Expat License: Expat @@ -31,4 +32,3 @@ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff -Nru node-tape-4.9.1/debian/dirs node-tape-4.11.0/debian/dirs --- node-tape-4.9.1/debian/dirs 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/dirs 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/bin diff -Nru node-tape-4.9.1/debian/gbp.conf node-tape-4.11.0/debian/gbp.conf --- node-tape-4.9.1/debian/gbp.conf 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/debian/gbp.conf 2020-12-16 13:18:39.000000000 +0000 @@ -0,0 +1,5 @@ +[DEFAULT] +pristine-tar = True + +[import-orig] +filter = [ '.gitignore', '.travis.yml', '.git*' ] diff -Nru node-tape-4.9.1/debian/install node-tape-4.11.0/debian/install --- node-tape-4.9.1/debian/install 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/install 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -package.json usr/lib/nodejs/tape/ -lib usr/lib/nodejs/tape/ -index.js usr/lib/nodejs/tape/ -bin usr/lib/nodejs/tape/ diff -Nru node-tape-4.9.1/debian/links node-tape-4.11.0/debian/links --- node-tape-4.9.1/debian/links 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/links 1970-01-01 00:00:00.000000000 +0000 @@ -1 +0,0 @@ -usr/lib/nodejs/tape/bin/tape usr/bin/tape diff -Nru node-tape-4.9.1/debian/manpages node-tape-4.11.0/debian/manpages --- node-tape-4.9.1/debian/manpages 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/manpages 2020-12-16 13:18:39.000000000 +0000 @@ -1 +1 @@ -debian/tape.1 \ No newline at end of file +debian/tape.1 diff -Nru node-tape-4.9.1/debian/nodejs/links node-tape-4.11.0/debian/nodejs/links --- node-tape-4.9.1/debian/nodejs/links 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/debian/nodejs/links 2020-12-16 14:12:18.000000000 +0000 @@ -0,0 +1 @@ +tape/bin/tape /usr/bin/tape diff -Nru node-tape-4.9.1/debian/patches/0001-Drop-has-package.patch node-tape-4.11.0/debian/patches/0001-Drop-has-package.patch --- node-tape-4.9.1/debian/patches/0001-Drop-has-package.patch 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/patches/0001-Drop-has-package.patch 2020-12-16 13:18:39.000000000 +0000 @@ -12,8 +12,6 @@ package.json | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) -diff --git a/lib/results.js b/lib/results.js -index 56fdc4b..34d5545 100644 --- a/lib/results.js +++ b/lib/results.js @@ -5,7 +5,7 @@ var through = require('through'); @@ -25,8 +23,6 @@ var regexpTest = bind.call(Function.call, RegExp.prototype.test); var yamlIndicators = /\:|\-|\?/; var nextTick = typeof setImmediate !== 'undefined' -diff --git a/lib/test.js b/lib/test.js -index d31c255..5fee85a 100644 --- a/lib/test.js +++ b/lib/test.js @@ -3,9 +3,9 @@ var defined = require('defined'); @@ -40,15 +36,13 @@ var forEach = require('for-each'); var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); var toLowerCase = bind.call(Function.call, String.prototype.toLowerCase); -diff --git a/package.json b/package.json -index 354730b..48beb49 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,6 @@ "for-each": "~0.3.3", "function-bind": "~1.1.1", - "glob": "~7.1.2", + "glob": "~7.1.4", - "has": "~1.0.3", - "inherits": "~2.0.3", + "inherits": "~2.0.4", "minimist": "~1.2.0", "object-inspect": "~1.6.0", diff -Nru node-tape-4.9.1/debian/patches/0002-Replace-for-each-package-by-lodash.foreach.patch node-tape-4.11.0/debian/patches/0002-Replace-for-each-package-by-lodash.foreach.patch --- node-tape-4.9.1/debian/patches/0002-Replace-for-each-package-by-lodash.foreach.patch 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/patches/0002-Replace-for-each-package-by-lodash.foreach.patch 2020-12-16 14:06:58.000000000 +0000 @@ -10,11 +10,9 @@ test/end-as-callback.js | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) -diff --git a/lib/test.js b/lib/test.js -index 5fee85a..f8b7f5c 100644 --- a/lib/test.js +++ b/lib/test.js -@@ -6,7 +6,7 @@ var EventEmitter = require('events').EventEmitter; +@@ -6,7 +6,7 @@ var trim = require('string.prototype.trim'); var bind = require('function-bind'); var has = bind.call(Function.call, Object.prototype.hasOwnProperty); @@ -23,8 +21,6 @@ var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); var toLowerCase = bind.call(Function.call, String.prototype.toLowerCase); -diff --git a/package.json b/package.json -index 48beb49..543fcaf 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ @@ -34,10 +30,8 @@ - "for-each": "~0.3.3", + "lodash.foreach": ">4.0", "function-bind": "~1.1.1", - "glob": "~7.1.2", - "inherits": "~2.0.3", -diff --git a/test/end-as-callback.js b/test/end-as-callback.js -index f8791c0..3f48ef4 100644 + "glob": "~7.1.4", + "inherits": "~2.0.4", --- a/test/end-as-callback.js +++ b/test/end-as-callback.js @@ -1,5 +1,5 @@ @@ -47,3 +41,13 @@ var tape = require("../"); var concat = require('concat-stream'); +--- a/test/objectMode.js ++++ b/test/objectMode.js +@@ -1,6 +1,6 @@ + var tap = require('tap'); + var tape = require('../'); +-var forEach = require('for-each'); ++var forEach = require('lodash.foreach'); + var through = require('through'); + + tap.test('object results', function (assert) { diff -Nru node-tape-4.9.1/debian/patches/0003-Remove-depends-to-trim.patch node-tape-4.11.0/debian/patches/0003-Remove-depends-to-trim.patch --- node-tape-4.9.1/debian/patches/0003-Remove-depends-to-trim.patch 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/patches/0003-Remove-depends-to-trim.patch 2020-12-16 13:18:39.000000000 +0000 @@ -11,11 +11,9 @@ package.json | 1 - 2 files changed, 12 insertions(+), 2 deletions(-) -diff --git a/lib/test.js b/lib/test.js -index f8b7f5c..748e867 100644 --- a/lib/test.js +++ b/lib/test.js -@@ -3,13 +3,24 @@ var defined = require('defined'); +@@ -3,13 +3,24 @@ var path = require('path'); var inherits = require('inherits'); var EventEmitter = require('events').EventEmitter; @@ -41,13 +39,11 @@ module.exports = Test; var nextTick = typeof setImmediate !== 'undefined' -diff --git a/package.json b/package.json -index 543fcaf..b56721d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "object-inspect": "~1.6.0", - "resolve": "~1.7.1", + "resolve": "~1.11.1", "resumer": "~0.0.0", - "string.prototype.trim": "~1.1.2", "through": "~2.3.8" diff -Nru node-tape-4.9.1/debian/patches/0004-Fix-test-error.patch node-tape-4.11.0/debian/patches/0004-Fix-test-error.patch --- node-tape-4.9.1/debian/patches/0004-Fix-test-error.patch 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/patches/0004-Fix-test-error.patch 2020-12-16 13:18:39.000000000 +0000 @@ -11,11 +11,9 @@ test/too_many.js | 3 --- 3 files changed, 6 insertions(+), 9 deletions(-) -diff --git a/test/deep-equal-failure.js b/test/deep-equal-failure.js -index 48d0687..a15382c 100644 --- a/test/deep-equal-failure.js +++ b/test/deep-equal-failure.js -@@ -10,7 +10,7 @@ var stripFullStack = common.stripFullStack; +@@ -10,7 +10,7 @@ tap.test('deep equal failure', function (assert) { var test = tape.createHarness({ exit : false }); var stream = test.createStream(); @@ -24,7 +22,7 @@ assert.plan(3); stream.pipe(parser); -@@ -71,7 +71,7 @@ tap.test('deep equal failure', function (assert) { +@@ -71,7 +71,7 @@ tap.test('deep equal failure, depth 6, with option', function (assert) { var test = tape.createHarness({ exit : false }); var stream = test.createStream(); @@ -33,7 +31,7 @@ assert.plan(3); stream.pipe(parser); -@@ -132,7 +132,7 @@ tap.test('deep equal failure, depth 6, with option', function (assert) { +@@ -132,7 +132,7 @@ tap.test('deep equal failure, depth 6, without option', function (assert) { var test = tape.createHarness({ exit : false }); var stream = test.createStream(); @@ -42,11 +40,9 @@ assert.plan(3); stream.pipe(parser); -diff --git a/test/stackTrace.js b/test/stackTrace.js -index 8da3b52..387f9f7 100644 --- a/test/stackTrace.js +++ b/test/stackTrace.js -@@ -9,7 +9,7 @@ tap.test('preserves stack trace with newlines', function (tt) { +@@ -9,7 +9,7 @@ var test = tape.createHarness(); var stream = test.createStream(); @@ -55,29 +51,27 @@ var stackTrace = 'foo\n bar'; parser.once('assert', function (data) { -@@ -109,7 +109,7 @@ tap.test('preserves stack trace for failed assertions', function (tt) { +@@ -109,7 +109,7 @@ var test = tape.createHarness(); var stream = test.createStream(); - var parser = stream.pipe(tapParser()); + var parser = stream.pipe(new tapParser()); - var stack = '' + var stack = ''; parser.once('assert', function (data) { -@@ -174,7 +174,7 @@ tap.test('preserves stack trace for failed assertions where actual===falsy', fun +@@ -174,7 +174,7 @@ var test = tape.createHarness(); var stream = test.createStream(); - var parser = stream.pipe(tapParser()); + var parser = stream.pipe(new tapParser()); - var stack = '' + var stack = ''; parser.once('assert', function (data) { -diff --git a/test/too_many.js b/test/too_many.js -index 5c7e4b3..f468638 100644 --- a/test/too_many.js +++ b/test/too_many.js -@@ -28,9 +28,6 @@ tap.test('array test', function (tt) { +@@ -28,9 +28,6 @@ ' [... stack stripped ...]', ' at $TEST/too_many.js:$LINE:$COL', ' at eval (eval at ($TEST/too_many.js:$LINE:$COL))', diff -Nru node-tape-4.9.1/debian/patches/0005-Improve-version-packaging-for-resolve.patch node-tape-4.11.0/debian/patches/0005-Improve-version-packaging-for-resolve.patch --- node-tape-4.9.1/debian/patches/0005-Improve-version-packaging-for-resolve.patch 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/patches/0005-Improve-version-packaging-for-resolve.patch 2020-12-16 13:18:39.000000000 +0000 @@ -10,15 +10,13 @@ package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -diff --git a/package.json b/package.json -index b56721d..9b986bb 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ - "inherits": "~2.0.3", + "inherits": "~2.0.4", "minimist": "~1.2.0", "object-inspect": "~1.6.0", -- "resolve": "~1.7.1", +- "resolve": "~1.11.1", + "resolve": ">1.4.0", "resumer": "~0.0.0", "through": "~2.3.8" diff -Nru node-tape-4.9.1/debian/patches/fix-register-paths.patch node-tape-4.11.0/debian/patches/fix-register-paths.patch --- node-tape-4.9.1/debian/patches/fix-register-paths.patch 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/debian/patches/fix-register-paths.patch 2020-12-16 13:54:32.000000000 +0000 @@ -0,0 +1,19 @@ +Description: fix register paths +Author: Xavier Guimard +Forwarded: no +Last-Update: 2020-12-16 + +--- a/bin/tape ++++ b/bin/tape +@@ -22,7 +22,11 @@ + /* This check ensures we ignore `-r ""`, trailing `-r`, or + * other silly things the user might (inadvertently) be doing. + */ ++ try { + require(resolveModule(module, { basedir: cwd })); ++ } catch(e) { ++ require(resolveModule(module, { basedir: '/usr/share/nodejs' })); ++ } + } + }); + diff -Nru node-tape-4.9.1/debian/patches/series node-tape-4.11.0/debian/patches/series --- node-tape-4.9.1/debian/patches/series 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/patches/series 2020-12-16 14:07:05.000000000 +0000 @@ -3,3 +3,4 @@ 0003-Remove-depends-to-trim.patch 0004-Fix-test-error.patch 0005-Improve-version-packaging-for-resolve.patch +fix-register-paths.patch diff -Nru node-tape-4.9.1/debian/rules node-tape-4.11.0/debian/rules --- node-tape-4.9.1/debian/rules 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/rules 2020-12-16 13:18:39.000000000 +0000 @@ -9,15 +9,6 @@ #override_dh_auto_build: -override_dh_auto_test: -ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) - tap -R spec test/*.js -else - @echo '**********************************************************' - @echo 'Skip test suite ' - @echo '**********************************************************' -endif - override_dh_installexamples: ifeq (,$(filter nodoc,$(DEB_BUILD_OPTIONS) $(DEB_BUILD_PROFILES))) dh_installexamples diff -Nru node-tape-4.9.1/debian/salsa-ci.yml node-tape-4.11.0/debian/salsa-ci.yml --- node-tape-4.9.1/debian/salsa-ci.yml 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/debian/salsa-ci.yml 2020-12-16 13:18:39.000000000 +0000 @@ -0,0 +1,4 @@ +--- +include: + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml + - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/pipeline-jobs.yml diff -Nru node-tape-4.9.1/debian/tests/control node-tape-4.11.0/debian/tests/control --- node-tape-4.9.1/debian/tests/control 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 @@ -1,20 +0,0 @@ -Tests: require -Depends: node-tape, nodejs (>= 6) - -Tests: runtestsuite -Depends: node-tape, nodejs (>= 6) - , node-falafel (>= 2.1.0) - , node-concat-stream (>= 1.5) - , node-tap (>= 8) - , node-js-yaml (>= 3.10) - , node-tap-parser (>= 3.0) - , node-function-bind (>= 1.1.1) - -Tests: runtestsuitelocal -Depends: node-tape, nodejs (>= 6) - , node-falafel (>= 2.1.0) - , node-concat-stream (>= 1.5) - , node-tap (>= 8) - , node-js-yaml (>= 3.10) - , node-tap-parser (>= 3.0) - , node-function-bind (>= 1.1.1) diff -Nru node-tape-4.9.1/debian/tests/pkg-js/test node-tape-4.11.0/debian/tests/pkg-js/test --- node-tape-4.9.1/debian/tests/pkg-js/test 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/debian/tests/pkg-js/test 2020-12-16 14:17:26.000000000 +0000 @@ -0,0 +1 @@ +tap -R spec `ls test/*.js|grep -v test/not-deep-equal-failure.js|grep -v test/not-equal-failure.js|grep -v test/exit.js` diff -Nru node-tape-4.9.1/debian/tests/require node-tape-4.11.0/debian/tests/require --- node-tape-4.9.1/debian/tests/require 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/tests/require 1970-01-01 00:00:00.000000000 +0000 @@ -1,3 +0,0 @@ -#!/bin/sh -set -e -node -e "require('tape');" diff -Nru node-tape-4.9.1/debian/tests/runtestsuite node-tape-4.11.0/debian/tests/runtestsuite --- node-tape-4.9.1/debian/tests/runtestsuite 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/tests/runtestsuite 1970-01-01 00:00:00.000000000 +0000 @@ -1,34 +0,0 @@ -#!/bin/sh -set -e - -# notice the / at end in order to load this module -PACKAGE='tape' -SEDCMD="s,(require|resolve)\s*[(]\s*'[.][.]/[.][.],\\1('$PACKAGE,g" -SEDCMD2="s,(require|resolve)\s*[(]\s*'[.][.]/,\\1('$PACKAGE,g" -SEDERROR="Code[[:space:]]*coverage[ ]*is[ ]*disabled" - -tmpdir=$(mktemp -d) -trap 'rm -rf "$tmpdir"' EXIT INT TERM HUP - -cp -r test $tmpdir/test -cd $tmpdir/ -rm test/exit.js -rm test/stackTrace.js -rm test/require.js -ln -s /usr/lib/nodejs/tape/index.js index.js - -TAPCMD="" - -TAPCMD() { - set -e; - tap -R spec test/*.js -} - -SEDERROR () { - set -e - sed -e "/$SEDERROR/w /dev/fd/2" -e "/$SEDERROR/d" -} - -TAPCMD 2> error.log -exec 3>&1 ;SEDERROR < error.log 2>&3 >&2 3>&- - diff -Nru node-tape-4.9.1/debian/tests/runtestsuitelocal node-tape-4.11.0/debian/tests/runtestsuitelocal --- node-tape-4.9.1/debian/tests/runtestsuitelocal 2018-06-24 21:32:53.000000000 +0000 +++ node-tape-4.11.0/debian/tests/runtestsuitelocal 1970-01-01 00:00:00.000000000 +0000 @@ -1,24 +0,0 @@ -#!/bin/sh -set -e - -# notice the / at end in order to load this module -PACKAGE='tape' -SEDCMD="s,(require|resolve)\s*[(]\s*'[.][.]/[.][.],\\1('$PACKAGE,g" -SEDCMD2="s,(require|resolve)\s*[(]\s*'[.][.]/,\\1('$PACKAGE,g" -SEDERROR="Code[[:space:]]*coverage[ ]*is[ ]*disabled" - -TAPCMD="" - -TAPCMD() { - set -e; - tap -R spec test/*.js -} - -SEDERROR () { - set -e - sed -e "/$SEDERROR/w /dev/fd/2" -e "/$SEDERROR/d" -} - -TAPCMD 2> error.log -exec 3>&1 ;SEDERROR < error.log 2>&3 >&2 3>&- - diff -Nru node-tape-4.9.1/debian/upstream/metadata node-tape-4.11.0/debian/upstream/metadata --- node-tape-4.9.1/debian/upstream/metadata 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/debian/upstream/metadata 2020-12-16 13:18:39.000000000 +0000 @@ -0,0 +1,5 @@ +--- +Bug-Database: https://github.com/substack/tape/issues +Bug-Submit: https://github.com/substack/tape/issues/new +Repository: https://github.com/substack/tape.git +Repository-Browse: https://github.com/substack/tape diff -Nru node-tape-4.9.1/.eslintrc node-tape-4.11.0/.eslintrc --- node-tape-4.9.1/.eslintrc 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/.eslintrc 2019-06-29 06:01:20.000000000 +0000 @@ -2,5 +2,10 @@ "root": true, "rules": { "indent": ["error", 4], + "semi": ["error", "always"], + "space-before-function-paren": ["error", { + "anonymous": "always", + "named": "never", + }], }, } diff -Nru node-tape-4.9.1/example/stream/object.js node-tape-4.11.0/example/stream/object.js --- node-tape-4.9.1/example/stream/object.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/example/stream/object.js 2019-06-29 06:01:20.000000000 +0000 @@ -2,7 +2,7 @@ var path = require('path'); test.createStream({ objectMode: true }).on('data', function (row) { - console.log(JSON.stringify(row)) + console.log(JSON.stringify(row)); }); process.argv.slice(2).forEach(function (file) { diff -Nru node-tape-4.9.1/index.js node-tape-4.11.0/index.js --- node-tape-4.9.1/index.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/index.js 2019-06-29 06:01:20.000000000 +0000 @@ -40,15 +40,15 @@ return getHarness().onFinish.apply(this, arguments); }; - lazyLoad.onFailure = function() { + lazyLoad.onFailure = function () { return getHarness().onFailure.apply(this, arguments); }; - lazyLoad.getHarness = getHarness + lazyLoad.getHarness = getHarness; - return lazyLoad + return lazyLoad; - function getHarness (opts) { + function getHarness(opts) { if (!opts) opts = {}; opts.autoclose = !canEmitExit; if (!harness) harness = createExitHarness(opts); @@ -56,7 +56,7 @@ } })(); -function createExitHarness (conf) { +function createExitHarness(conf) { if (!conf) conf = {}; var harness = createHarness({ autoclose: defined(conf.autoclose, false) @@ -65,21 +65,19 @@ var stream = harness.createStream({ objectMode: conf.objectMode }); var es = stream.pipe(conf.stream || createDefaultStream()); if (canEmitExit) { - es.on('error', function (err) { harness._exitCode = 1 }); + es.on('error', function (err) { harness._exitCode = 1; }); } var ended = false; - stream.on('end', function () { ended = true }); + stream.on('end', function () { ended = true; }); if (conf.exit === false) return harness; if (!canEmitExit || !canExit) return harness; - var inErrorState = false; - process.on('exit', function (code) { // let the process exit cleanly. if (code !== 0) { - return + return; } if (!ended) { @@ -104,23 +102,23 @@ var exitInterval; -function createHarness (conf_) { +function createHarness(conf_) { if (!conf_) conf_ = {}; var results = createResult(); if (conf_.autoclose !== false) { - results.once('done', function () { results.close() }); + results.once('done', function () { results.close(); }); } var test = function (name, conf, cb) { var t = new Test(name, conf, cb); test._tests.push(t); - (function inspectCode (st) { - st.on('test', function sub (st_) { + (function inspectCode(st) { + st.on('test', function sub(st_) { inspectCode(st_); }); st.on('result', function (r) { - if (!r.ok && typeof r !== 'string') test._exitCode = 1 + if (!r.todo && !r.ok && typeof r !== 'string') test._exitCode = 1; }); })(t); @@ -153,7 +151,7 @@ }; test._exitCode = 0; - test.close = function () { results.close() }; + test.close = function () { results.close(); }; return test; } diff -Nru node-tape-4.9.1/lib/default_stream.js node-tape-4.11.0/lib/default_stream.js --- node-tape-4.9.1/lib/default_stream.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/lib/default_stream.js 2019-06-29 06:01:20.000000000 +0000 @@ -6,7 +6,7 @@ var stream = through(write, flush); return stream; - function write (buf) { + function write(buf) { for (var i = 0; i < buf.length; i++) { var c = typeof buf === 'string' ? buf.charAt(i) @@ -17,13 +17,13 @@ } } - function flush () { + function flush() { if (fs.writeSync && /^win/.test(process.platform)) { try { fs.writeSync(1, line + '\n'); } - catch (e) { stream.emit('error', e) } + catch (e) { stream.emit('error', e); } } else { - try { console.log(line) } - catch (e) { stream.emit('error', e) } + try { console.log(line); } + catch (e) { stream.emit('error', e); } } line = ''; } diff -Nru node-tape-4.9.1/lib/results.js node-tape-4.11.0/lib/results.js --- node-tape-4.9.1/lib/results.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/lib/results.js 2019-06-29 06:01:20.000000000 +0000 @@ -16,14 +16,20 @@ module.exports = Results; inherits(Results, EventEmitter); -function Results () { +function coalesceWhiteSpaces(str) { + return String(str).replace(/\s+/g, ' '); +} + +function Results() { if (!(this instanceof Results)) return new Results; this.count = 0; this.fail = 0; this.pass = 0; + this.todo = 0; this._stream = through(); this.tests = []; this._only = null; + this._isRunning = false; } Results.prototype.createStream = function (opts) { @@ -32,14 +38,16 @@ var output, testId = 0; if (opts.objectMode) { output = through(); - self.on('_push', function ontest (t, extra) { + self.on('_push', function ontest(t, extra) { if (!extra) extra = {}; var id = testId++; t.once('prerun', function () { var row = { type: 'test', name: t.name, - id: id + id: id, + skip: t._skip, + todo: t._todo }; if (has(extra, 'parent')) { row.parent = extra.parent; @@ -58,21 +66,24 @@ output.queue({ type: 'end', test: id }); }); }); - self.on('done', function () { output.queue(null) }); + self.on('done', function () { output.queue(null); }); } else { output = resumer(); output.queue('TAP version 13\n'); self._stream.pipe(output); } - nextTick(function next() { - var t; - while (t = getNextTest(self)) { - t.run(); - if (!t.ended) return t.once('end', function(){ nextTick(next); }); - } - self.emit('done'); - }); + if (!this._isRunning) { + this._isRunning = true; + nextTick(function next() { + var t; + while (t = getNextTest(self)) { + t.run(); + if (!t.ended) return t.once('end', function () { nextTick(next); }); + } + self.emit('done'); + }); + } return output; }; @@ -90,9 +101,12 @@ Results.prototype._watch = function (t) { var self = this; - var write = function (s) { self._stream.queue(s) }; + var write = function (s) { self._stream.queue(s); }; t.once('prerun', function () { - write('# ' + t.name + '\n'); + var premsg = ''; + if (t._skip) premsg = 'SKIP '; + else if (t._todo) premsg = 'TODO '; + write('# ' + premsg + coalesceWhiteSpaces(t.name) + '\n'); }); t.on('result', function (res) { @@ -103,38 +117,42 @@ write(encodeResult(res, self.count + 1)); self.count ++; - if (res.ok) self.pass ++ + if (res.ok || res.todo) self.pass ++; else { self.fail ++; self.emit('fail'); } }); - t.on('test', function (st) { self._watch(st) }); + t.on('test', function (st) { self._watch(st); }); }; Results.prototype.close = function () { var self = this; if (self.closed) self._stream.emit('error', new Error('ALREADY CLOSED')); self.closed = true; - var write = function (s) { self._stream.queue(s) }; + var write = function (s) { self._stream.queue(s); }; write('\n1..' + self.count + '\n'); write('# tests ' + self.count + '\n'); - write('# pass ' + self.pass + '\n'); - if (self.fail) write('# fail ' + self.fail + '\n') - else write('\n# ok\n') + write('# pass ' + (self.pass + self.todo) + '\n'); + if (self.todo) write('# todo ' + self.todo + '\n'); + if (self.fail) write('# fail ' + self.fail + '\n'); + else write('\n# ok\n'); self._stream.queue(null); }; -function encodeResult (res, count) { +function encodeResult(res, count) { var output = ''; output += (res.ok ? 'ok ' : 'not ok ') + count; - output += res.name ? ' ' + res.name.toString().replace(/\s+/g, ' ') : ''; + output += res.name ? ' ' + coalesceWhiteSpaces(res.name) : ''; - if (res.skip) output += ' # SKIP'; - else if (res.todo) output += ' # TODO'; + if (res.skip) { + output += ' # SKIP' + ((typeof res.skip === 'string') ? ' ' + coalesceWhiteSpaces(res.skip) : ''); + } else if (res.todo) { + output += ' # TODO' + ((typeof res.todo === 'string') ? ' ' + coalesceWhiteSpaces(res.todo) : ''); + }; output += '\n'; if (res.ok) return output; @@ -175,7 +193,7 @@ return output; } -function getNextTest (results) { +function getNextTest(results) { if (!results._only) { return results.tests.shift(); } @@ -186,9 +204,9 @@ if (results._only === t) { return t; } - } while (results.tests.length !== 0) + } while (results.tests.length !== 0); } -function invalidYaml (str) { +function invalidYaml(str) { return regexpTest(yamlIndicators, str); } diff -Nru node-tape-4.9.1/lib/test.js node-tape-4.11.0/lib/test.js --- node-tape-4.9.1/lib/test.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/lib/test.js 2019-06-29 06:01:20.000000000 +0000 @@ -39,7 +39,7 @@ return { name: name, opts: opts, cb: cb }; }; -function Test (name_, opts_, cb_) { +function Test(name_, opts_, cb_) { if (! (this instanceof Test)) { return new Test(name_, opts_, cb_); } @@ -51,6 +51,7 @@ this.assertCount = 0; this.pendingCount = 0; this._skip = args.opts.skip || false; + this._todo = args.opts.todo || false; this._timeout = args.opts.timeout; this._plan = undefined; this._cb = args.cb; @@ -82,16 +83,13 @@ } Test.prototype.run = function () { - if (this._skip) { - this.comment('SKIP ' + this.name); - } + this.emit('prerun'); if (!this._cb || this._skip) { return this._end(); } if (this._timeout != null) { this.timeoutAfter(this._timeout); } - this.emit('prerun'); this._cb(this); this.emit('run'); }; @@ -104,7 +102,7 @@ this.emit('test', t); t.on('prerun', function () { self.assertCount++; - }) + }); if (!self._pendingAsserts()) { nextTick(function () { @@ -112,7 +110,7 @@ }); } - nextTick(function() { + nextTick(function () { if (!self._plan && self.pendingCount == self._progeny.length) { self._end(); } @@ -131,17 +129,17 @@ this.emit('plan', n); }; -Test.prototype.timeoutAfter = function(ms) { +Test.prototype.timeoutAfter = function (ms) { if (!ms) throw new Error('timeoutAfter requires a timespan'); var self = this; - var timeout = safeSetTimeout(function() { + var timeout = safeSetTimeout(function () { self.fail('test timed out after ' + ms + 'ms'); self.end(); }, ms); - this.once('end', function() { + this.once('end', function () { safeClearTimeout(timeout); }); -} +}; Test.prototype.end = function (err) { var self = this; @@ -160,7 +158,7 @@ var self = this; if (this._progeny.length) { var t = this._progeny.shift(); - t.on('end', function () { self._end() }); + t.on('end', function () { self._end(); }); t.run(); return; } @@ -200,17 +198,20 @@ return this._plan - (this._progeny.length + this.assertCount); }; -Test.prototype._assert = function assert (ok, opts) { +Test.prototype._assert = function assert(ok, opts) { var self = this; var extra = opts.extra || {}; + ok = !!ok || !!extra.skip; + var res = { - id : self.assertCount ++, - ok : Boolean(ok), - skip : defined(extra.skip, opts.skip), - name : defined(extra.message, opts.message, '(unnamed assert)'), - operator : defined(extra.operator, opts.operator), - objectPrintDepth : self._objectPrintDepth + id: self.assertCount++, + ok: ok, + skip: defined(extra.skip, opts.skip), + todo: defined(extra.todo, opts.todo, self._todo), + name: defined(extra.message, opts.message, '(unnamed assert)'), + operator: defined(extra.operator, opts.operator), + objectPrintDepth: self._objectPrintDepth }; if (has(opts, 'actual') || has(extra, 'actual')) { res.actual = defined(extra.actual, opts.actual); @@ -218,9 +219,9 @@ if (has(opts, 'expected') || has(extra, 'expected')) { res.expected = defined(extra.expected, opts.expected); } - this._ok = Boolean(this._ok && ok); + this._ok = !!(this._ok && ok); - if (!ok) { + if (!ok && !res.todo) { res.error = defined(extra.error, opts.error, new Error(res.name)); } @@ -263,9 +264,9 @@ Last part captures file path plus line no (and optional column no). - /((?:\/|[A-Z]:\\)[^:\)]+:(\d+)(?::(\d+))?)/ + /((?:\/|[a-zA-Z]:\\)[^:\)]+:(\d+)(?::(\d+))?)/ */ - var re = /^(?:[^\s]*\s*\bat\s+)(?:(.*)\s+\()?((?:\/|[A-Z]:\\)[^:\)]+:(\d+)(?::(\d+))?)/ + var re = /^(?:[^\s]*\s*\bat\s+)(?:(.*)\s+\()?((?:\/|[a-zA-Z]:\\)[^:\)]+:(\d+)(?::(\d+))?)/; var m = re.exec(err[i]); if (!m) { @@ -281,7 +282,7 @@ // Function call description may not (just) be a function name. // Try to extract function name by looking at first "word" only. - res.functionName = callDescription.split(/\s+/)[0] + res.functionName = callDescription.split(/\s+/)[0]; res.file = filePath; res.line = Number(m[3]); if (m[4]) res.column = Number(m[4]); @@ -402,7 +403,7 @@ message : defined(msg, 'should not be equal'), operator : 'notEqual', actual : a, - notExpected : b, + expected : b, extra : extra }); } @@ -451,11 +452,12 @@ message : defined(msg, 'should not be equivalent'), operator : 'notDeepEqual', actual : a, - notExpected : b, + expected : b, extra : extra }); } Test.prototype.notDeepEqual += Test.prototype.notDeepEquals = Test.prototype.notEquivalent = Test.prototype.notDeeply = Test.prototype.notSame diff -Nru node-tape-4.9.1/LICENSE node-tape-4.11.0/LICENSE --- node-tape-4.9.1/LICENSE 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/LICENSE 2019-06-29 06:01:20.000000000 +0000 @@ -1,18 +1,21 @@ -This software is released under the MIT license: +MIT License -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of -the Software, and to permit persons to whom the Software is furnished to do so, -subject to the following conditions: +Copyright (c) 2012 James Halliday + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR -COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER -IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff -Nru node-tape-4.9.1/.npmrc node-tape-4.11.0/.npmrc --- node-tape-4.9.1/.npmrc 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/.npmrc 2019-06-29 06:01:20.000000000 +0000 @@ -1 +1,2 @@ package-lock=false +save-prefix=~ diff -Nru node-tape-4.9.1/package.json node-tape-4.11.0/package.json --- node-tape-4.9.1/package.json 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/package.json 2019-06-29 06:01:20.000000000 +0000 @@ -1,6 +1,6 @@ { "name": "tape", - "version": "4.9.1", + "version": "4.11.0", "description": "tap-producing test harness for node and browsers", "main": "index.js", "bin": "./bin/tape", @@ -13,22 +13,22 @@ "defined": "~1.0.0", "for-each": "~0.3.3", "function-bind": "~1.1.1", - "glob": "~7.1.2", + "glob": "~7.1.4", "has": "~1.0.3", - "inherits": "~2.0.3", + "inherits": "~2.0.4", "minimist": "~1.2.0", "object-inspect": "~1.6.0", - "resolve": "~1.7.1", + "resolve": "~1.11.1", "resumer": "~0.0.0", "string.prototype.trim": "~1.1.2", "through": "~2.3.8" }, "devDependencies": { "concat-stream": "^1.6.2", - "eclint": "^2.7.0", - "eslint": "^4.19.1", + "eclint": "^2.8.1", + "eslint": "^5.16.0", "falafel": "^2.1.0", - "js-yaml": "^3.12.0", + "js-yaml": "^3.13.1", "tap": "^8.0.1", "tap-parser": "^3.0.5" }, diff -Nru node-tape-4.9.1/readme.markdown node-tape-4.11.0/readme.markdown --- node-tape-4.9.1/readme.markdown 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/readme.markdown 2019-06-29 06:01:20.000000000 +0000 @@ -6,7 +6,7 @@ [![build status](https://secure.travis-ci.org/substack/tape.svg?branch=master)](http://travis-ci.org/substack/tape) -![tape](http://substack.net/images/tape_drive.png) +![tape](https://web.archive.org/web/20170612184731if_/http://substack.net/images/tape_drive.png) # example @@ -86,7 +86,7 @@ # things that go well with tape -tape maintains a fairly minimal core. Additional features are usually added by using another module alongside tape. +`tape` maintains a fairly minimal core. Additional features are usually added by using another module alongside `tape`. ## pretty reporters @@ -95,46 +95,50 @@ If you want a more colorful / pretty output there are lots of modules on npm that will output something pretty if you pipe TAP into them: - - https://github.com/scottcorgan/tap-spec - - https://github.com/scottcorgan/tap-dot - - https://github.com/substack/faucet - - https://github.com/juliangruber/tap-bail - - https://github.com/kirbysayshi/tap-browser-color - - https://github.com/gummesson/tap-json - - https://github.com/derhuerst/tap-min - - https://github.com/calvinmetcalf/tap-nyan - - https://www.npmjs.org/package/tap-pessimist - - https://github.com/toolness/tap-prettify - - https://github.com/shuhei/colortape - - https://github.com/aghassemi/tap-xunit - - https://github.com/namuol/tap-difflet - - https://github.com/gritzko/tape-dom - - https://github.com/axross/tap-diff - - https://github.com/axross/tap-notify - - https://github.com/zoubin/tap-summary - - https://github.com/Hypercubed/tap-markdown - - https://github.com/gabrielcsapo/tap-html - - https://github.com/mcnuttandrew/tap-react-browser +- [tap-spec](https://github.com/scottcorgan/tap-spec) +- [tap-dot](https://github.com/scottcorgan/tap-dot) +- [faucet](https://github.com/substack/faucet) +- [tap-bail](https://github.com/juliangruber/tap-bail) +- [tap-browser-color](https://github.com/kirbysayshi/tap-browser-color) +- [tap-json](https://github.com/gummesson/tap-json) +- [tap-min](https://github.com/derhuerst/tap-min) +- [tap-nyan](https://github.com/calvinmetcalf/tap-nyan) +- [tap-pessimist](https://www.npmjs.org/package/tap-pessimist) +- [tap-prettify](https://github.com/toolness/tap-prettify) +- [colortape](https://github.com/shuhei/colortape) +- [tap-xunit](https://github.com/aghassemi/tap-xunit) +- [tap-difflet](https://github.com/namuol/tap-difflet) +- [tape-dom](https://github.com/gritzko/tape-dom) +- [tap-diff](https://github.com/axross/tap-diff) +- [tap-notify](https://github.com/axross/tap-notify) +- [tap-summary](https://github.com/zoubin/tap-summary) +- [tap-markdown](https://github.com/Hypercubed/tap-markdown) +- [tap-html](https://github.com/gabrielcsapo/tap-html) +- [tap-react-browser](https://github.com/mcnuttandrew/tap-react-browser) +- [tap-junit](https://github.com/dhershman1/tap-junit) To use them, try `node test/index.js | tap-spec` or pipe it into one of the modules of your choice! ## uncaught exceptions -By default, uncaught exceptions in your tests will not be intercepted, and will cause tape to crash. If you find this behavior undesirable, use [tape-catch](https://github.com/michaelrhodes/tape-catch) to report any exceptions as TAP errors. +By default, uncaught exceptions in your tests will not be intercepted, and will cause `tape` to crash. If you find this behavior undesirable, use [`tape-catch`](https://github.com/michaelrhodes/tape-catch) to report any exceptions as TAP errors. ## other - CoffeeScript support with https://www.npmjs.com/package/coffeetape -- Promise support with https://www.npmjs.com/package/blue-tape -- ES6 support with https://www.npmjs.com/package/babel-tape-runner +- Promise support with https://www.npmjs.com/package/blue-tape or https://www.npmjs.com/package/tape-promise +- ES6 support with https://www.npmjs.com/package/babel-tape-runner or https://www.npmjs.com/package/buble-tape-runner +- Different test syntax with https://github.com/pguth/flip-tape (warning: mutates String.prototype) +- Electron test runner with https://github.com/tundrax/electron-tap +- Concurrency support with https://github.com/imsnif/mixed-tape # methods -The assertion methods in tape are heavily influenced or copied from the methods +The assertion methods in `tape` are heavily influenced or copied from the methods in [node-tap](https://github.com/isaacs/node-tap). -``` +```js var test = require('tape') ``` @@ -148,22 +152,23 @@ - opts.skip = true/false. See test.skip. - opts.timeout = 500. Set a timeout for the test, after which it will fail. See test.timeoutAfter. - opts.objectPrintDepth = 5. Configure max depth of expected / actual object printing. Environmental variable `NODE_TAPE_OBJECT_PRINT_DEPTH` can set the desired default depth for all tests; locally-set values will take precedence. +- opts.todo = true/false. Test will be allowed to fail. If you forget to `t.plan()` out how many assertions you are going to run and you don't call `t.end()` explicitly, your test will hang. -## test.skip(name, cb) +## test.skip([name], [opts], cb) Generate a new test that will be skipped over. ## test.onFinish(fn) -The onFinish hook will get invoked when ALL tape tests have finished -right before tape is about to print the test summary. +The onFinish hook will get invoked when ALL `tape` tests have finished +right before `tape` is about to print the test summary. ## test.onFailure(fn) -The onFailure hook will get invoked whenever any tape tests has failed. +The onFailure hook will get invoked whenever any `tape` tests has failed. ## t.plan(n) @@ -239,7 +244,7 @@ [node's deepEqual() algorithm](https://github.com/substack/node-deep-equal) with strict comparisons (`===`) on leaf nodes and an optional description of the assertion `msg`. -Aliases: `t.notEquivalent()`, `t.notDeeply()`, `t.notSame()`, +Aliases: `t.notDeepEquals`, `t.notEquivalent()`, `t.notDeeply()`, `t.notSame()`, `t.isNotDeepEqual()`, `t.isNotDeeply()`, `t.isNotEquivalent()`, `t.isInequivalent()` @@ -265,7 +270,7 @@ ## t.doesNotThrow(fn, expected, msg) -Assert that the function call `fn()` does not throw an exception. `msg` is an optional description of the assertion. +Assert that the function call `fn()` does not throw an exception. `expected`, if present, limits what should not be thrown. For example, set `expected` to `/user/` to fail the test only if the string representation of the exception contains the word `user`. Any other exception would pass the test. If `expected` is omitted, any exception will fail the test. `msg` is an optional description of the assertion. ## t.test(name, [opts], cb) @@ -288,11 +293,11 @@ someplace else if you `htest.createStream().pipe()` to a destination stream on the first tick. -## test.only(name, cb) +## test.only([name], [opts], cb) -Like `test(name, cb)` except if you use `.only` this is the only test case -that will run for the entire process, all other test cases using tape will -be ignored +Like `test([name], [opts], cb)` except if you use `.only` this is the only test case +that will run for the entire process, all other test cases using `tape` will +be ignored. ## var stream = test.createStream(opts) @@ -321,7 +326,7 @@ Pass in test files to run as arguments: -``` +```sh $ node tap.js test/x.js test/y.js TAP version 13 # (anonymous) @@ -362,7 +367,7 @@ The output for this runner is: -``` +```sh $ node object.js test/x.js test/y.js {"type":"test","name":"(anonymous)","id":0} {"id":0,"ok":false,"name":"should be equal","operator":"equal","actual":"beep","expected":"boop","error":{},"test":0,"type":"assert"} @@ -380,7 +385,7 @@ With [npm](https://npmjs.org) do: -``` +```sh npm install tape --save-dev ``` diff -Nru node-tape-4.9.1/test/add-subtest-async.js node-tape-4.11.0/test/add-subtest-async.js --- node-tape-4.9.1/test/add-subtest-async.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/add-subtest-async.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,11 +1,11 @@ -var test = require('../') +var test = require('../'); test('parent', function (t) { t.pass('parent'); setTimeout(function () { - t.test('child', function (t) { - t.pass('child'); - t.end(); + t.test('child', function (st) { + st.pass('child'); + st.end(); }); - }, 100) -}) + }, 100); +}); diff -Nru node-tape-4.9.1/test/anonymous-fn/test-wrapper.js node-tape-4.11.0/test/anonymous-fn/test-wrapper.js --- node-tape-4.9.1/test/anonymous-fn/test-wrapper.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/anonymous-fn/test-wrapper.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,11 +1,11 @@ // Example of wrapper function that would invoke tape module.exports = function (testCase) { - return function(t) { + return function (t) { setUp(); testCase(t); tearDown(); }; -} +}; function setUp() { // ... example ... diff -Nru node-tape-4.9.1/test/child_ordering.js node-tape-4.11.0/test/child_ordering.js --- node-tape-4.9.1/test/child_ordering.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/child_ordering.js 2019-06-29 06:01:20.000000000 +0000 @@ -2,8 +2,8 @@ var childRan = false; -test('parent', function(t) { - t.test('child', function(t) { +test('parent', function (t) { + t.test('child', function (t) { childRan = true; t.pass('child ran'); t.end(); @@ -11,7 +11,7 @@ t.end(); }); -test('uncle', function(t) { +test('uncle', function (t) { t.ok(childRan, 'Child should run before next top-level test'); t.end(); }); @@ -19,13 +19,13 @@ var grandParentRan = false; var parentRan = false; var grandChildRan = false; -test('grandparent', function(t) { +test('grandparent', function (t) { t.ok(!grandParentRan, 'grand parent ran twice'); grandParentRan = true; - t.test('parent', function(t) { + t.test('parent', function (t) { t.ok(!parentRan, 'parent ran twice'); parentRan = true; - t.test('grandchild', function(t) { + t.test('grandchild', function (t) { t.ok(!grandChildRan, 'grand child ran twice'); grandChildRan = true; t.pass('grand child ran'); @@ -34,7 +34,7 @@ t.pass('parent ran'); t.end(); }); - t.test('other parent', function(t) { + t.test('other parent', function (t) { t.ok(parentRan, 'first parent runs before second parent'); t.ok(grandChildRan, 'grandchild runs before second parent'); t.end(); @@ -43,7 +43,7 @@ t.end(); }); -test('second grandparent', function(t) { +test('second grandparent', function (t) { t.ok(grandParentRan, 'grandparent ran'); t.ok(parentRan, 'parent ran'); t.ok(grandChildRan, 'grandchild ran'); diff -Nru node-tape-4.9.1/test/circular-things.js node-tape-4.11.0/test/circular-things.js --- node-tape-4.9.1/test/circular-things.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/circular-things.js 2019-06-29 06:01:20.000000000 +0000 @@ -40,5 +40,5 @@ var circular = {}; circular.circular = circular; t.equal(circular, {}); - }) -}) + }); +}); diff -Nru node-tape-4.9.1/test/common.js node-tape-4.11.0/test/common.js --- node-tape-4.9.1/test/common.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/common.js 2019-06-29 06:01:20.000000000 +0000 @@ -14,7 +14,7 @@ delete withStack.stack; delete withStack.at; return withStack; -} +}; // There are three challenges associated with checking the stack traces included // in errors: @@ -43,7 +43,7 @@ var withoutLineNumbers = withoutPathSep.replace(/:\d+:\d+/g, ':$LINE:$COL'); var withoutNestedLineNumbers = withoutLineNumbers.replace(/, \:\$LINE:\$COL\)$/, ')'); return withoutNestedLineNumbers; - } + }; if (m) { if (m[1].slice(0, __dirname.length) === __dirname) { @@ -52,7 +52,7 @@ return stripped; } return stripChangingData(line); - }) + }); var deduped = withDuplicates.filter(function (line, ix) { var hasPrior = line === stripped && withDuplicates[ix - 1] === stripped; @@ -60,4 +60,4 @@ }); return deduped.join('\n'); -} +}; diff -Nru node-tape-4.9.1/test/create_multiple_streams.js node-tape-4.11.0/test/create_multiple_streams.js --- node-tape-4.9.1/test/create_multiple_streams.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/create_multiple_streams.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,31 @@ +var tape = require('../'); + +tape.test('createMultipleStreams', function (tt) { + tt.plan(2); + + var th = tape.createHarness(); + th.createStream(); + th.createStream(); + + var testOneComplete = false; + + th('test one', function (tht) { + tht.plan(1); + setTimeout( function () { + tht.pass(); + testOneComplete = true; + }, 100); + }); + + th('test two', function (tht) { + tht.ok(testOneComplete, 'test 1 completed before test 2'); + tht.end(); + }); + + th.onFinish(function () { + tt.equal(th._results.count, 2, "harness test ran"); + tt.equal(th._results.fail, 0, "harness test didn't fail"); + }); +}); + + diff -Nru node-tape-4.9.1/test/deep-equal-failure.js node-tape-4.11.0/test/deep-equal-failure.js --- node-tape-4.9.1/test/deep-equal-failure.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/deep-equal-failure.js 2019-06-29 06:01:20.000000000 +0000 @@ -66,7 +66,7 @@ t.plan(1); t.equal({a: 1}, {b: 2}); }); -}) +}); tap.test('deep equal failure, depth 6, with option', function (assert) { var test = tape.createHarness({ exit : false }); @@ -127,7 +127,7 @@ t.plan(1); t.equal({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 2 } } } } } }); }); -}) +}); tap.test('deep equal failure, depth 6, without option', function (assert) { var test = tape.createHarness({ exit : false }); @@ -188,4 +188,4 @@ t.plan(1); t.equal({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 2 } } } } } }); }); -}) +}); diff -Nru node-tape-4.9.1/test/double_end.js node-tape-4.11.0/test/double_end.js --- node-tape-4.9.1/test/double_end.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/double_end.js 2019-06-29 06:01:20.000000000 +0000 @@ -18,7 +18,7 @@ // This code is unfortunately by necessity highly coupled to node // versions, and may require tweaking with future versions of the timers // library. - function doEnd() { throw new Error() }; + function doEnd() { throw new Error(); }; var to = setTimeout(doEnd, 5000); clearTimeout(to); to._onTimeout = doEnd; diff -Nru node-tape-4.9.1/test/end-as-callback.js node-tape-4.11.0/test/end-as-callback.js --- node-tape-4.9.1/test/end-as-callback.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/end-as-callback.js 2019-06-29 06:01:20.000000000 +0000 @@ -4,7 +4,7 @@ var concat = require('concat-stream'); tap.test("tape assert.end as callback", function (tt) { - var test = tape.createHarness({ exit: false }) + var test = tape.createHarness({ exit: false }); test.createStream().pipe(concat(function (rows) { tt.equal(rows.toString('utf8'), [ @@ -23,38 +23,38 @@ '# pass 4', '# fail 1' ].join('\n') + '\n'); - tt.end() + tt.end(); })); test("do a task and write", function (assert) { fakeAsyncTask("foo", function (err, value) { - assert.ifError(err) - assert.equal(value, "taskfoo") + assert.ifError(err); + assert.equal(value, "taskfoo"); - fakeAsyncWrite("bar", assert.end) - }) - }) + fakeAsyncWrite("bar", assert.end); + }); + }); test("do a task and write fail", function (assert) { fakeAsyncTask("bar", function (err, value) { - assert.ifError(err) - assert.equal(value, "taskbar") + assert.ifError(err); + assert.equal(value, "taskbar"); - fakeAsyncWriteFail("baz", assert.end) - }) - }) -}) + fakeAsyncWriteFail("baz", assert.end); + }); + }); +}); function fakeAsyncTask(name, cb) { - cb(null, "task" + name) + cb(null, "task" + name); } function fakeAsyncWrite(name, cb) { - cb(null) + cb(null); } function fakeAsyncWriteFail(name, cb) { - cb(new Error("fail")) + cb(new Error("fail")); } /** diff -Nru node-tape-4.9.1/test/exit/todo_fail.js node-tape-4.11.0/test/exit/todo_fail.js --- node-tape-4.9.1/test/exit/todo_fail.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/exit/todo_fail.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,6 @@ +var test = require('../../'); + +test('todo fail', { todo: true }, function (t) { + t.plan(1); + t.ok(false); +}); diff -Nru node-tape-4.9.1/test/exit/todo.js node-tape-4.11.0/test/exit/todo.js --- node-tape-4.9.1/test/exit/todo.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/exit/todo.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,6 @@ +var test = require('../../'); + +test('todo pass', { todo: true }, function (t) { + t.plan(1); + t.ok(true); +}); diff -Nru node-tape-4.9.1/test/exit.js node-tape-4.11.0/test/exit.js --- node-tape-4.9.1/test/exit.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/exit.js 2019-06-29 06:01:20.000000000 +0000 @@ -27,7 +27,7 @@ '', // yes, these double-blank-lines at the end are required. '' // if you can figure out how to remove them, please do! ].join('\n')); - } + }; var ps = spawn(process.execPath, [path.join(__dirname, 'exit', 'ok.js')]); ps.stdout.pipe(concat(tc)); @@ -148,3 +148,57 @@ t.notEqual(code, 0); }); }); + +tap.test('todo passing', function (t) { + t.plan(2); + + var tc = function (rows) { + t.same(stripFullStack(rows.toString('utf8')), [ + 'TAP version 13', + '# TODO todo pass', + 'ok 1 should be truthy # TODO', + '', + '1..1', + '# tests 1', + '# pass 1', + '', + '# ok' + ].join('\n') + '\n\n'); + }; + + var ps = spawn(process.execPath, [path.join(__dirname, '/exit/todo.js')]); + ps.stdout.pipe(concat(tc)); + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); + +tap.test('todo failing', function (t) { + t.plan(2); + + var tc = function (rows) { + t.same(stripFullStack(rows.toString('utf8')), [ + 'TAP version 13', + '# TODO todo fail', + 'not ok 1 should be truthy # TODO', + ' ---', + ' operator: ok', + ' expected: true', + ' actual: false', + ' at: Test. ($TEST/exit/todo_fail.js:$LINE:$COL)', + ' ...', + '', + '1..1', + '# tests 1', + '# pass 1', + '', + '# ok' + ].join('\n') + '\n\n'); + }; + + var ps = spawn(process.execPath, [path.join(__dirname, '/exit/todo_fail.js')]); + ps.stdout.pipe(concat(tc)); + ps.on('exit', function (code) { + t.equal(code, 0); + }); +}); diff -Nru node-tape-4.9.1/test/exposed-harness.js node-tape-4.11.0/test/exposed-harness.js --- node-tape-4.9.1/test/exposed-harness.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/exposed-harness.js 2019-06-29 06:01:20.000000000 +0000 @@ -3,10 +3,10 @@ tap.test('main harness object is exposed', function (assert) { - assert.equal(typeof tape.getHarness, 'function', 'tape.getHarness is a function') + assert.equal(typeof tape.getHarness, 'function', 'tape.getHarness is a function'); - assert.equal(tape.getHarness()._results.pass, 0) + assert.equal(tape.getHarness()._results.pass, 0); - assert.end() + assert.end(); -}) +}); diff -Nru node-tape-4.9.1/test/many.js node-tape-4.11.0/test/many.js --- node-tape-4.9.1/test/many.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/many.js 2019-06-29 06:01:20.000000000 +0000 @@ -3,6 +3,6 @@ test('many tests', function (t) { t.plan(100); for (var i = 0; i < 100; i++) { - setTimeout(function () { t.pass() }, Math.random() * 50); + setTimeout(function () { t.pass(); }, Math.random() * 50); } }); diff -Nru node-tape-4.9.1/test/max_listeners/source.js node-tape-4.11.0/test/max_listeners/source.js --- node-tape-4.9.1/test/max_listeners/source.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/max_listeners/source.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,5 +1,5 @@ var test = require('../../'); for (var i = 0; i < 11; i ++) { - test(function (t) { t.ok(true, 'true is truthy'); t.end() }); + test(function (t) { t.ok(true, 'true is truthy'); t.end(); }); } diff -Nru node-tape-4.9.1/test/nested2.js node-tape-4.11.0/test/nested2.js --- node-tape-4.9.1/test/nested2.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/nested2.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,19 +1,19 @@ var test = require('../'); -test(function(t) { - var i = 0 - t.test('setup', function(t) { - process.nextTick(function() { - t.equal(i, 0, 'called once') - i++ - t.end() - }) - }) +test(function (t) { + var i = 0; + t.test('setup', function (t) { + process.nextTick(function () { + t.equal(i, 0, 'called once'); + i++; + t.end(); + }); + }); - t.test('teardown', function(t) { - t.end() - }) + t.test('teardown', function (t) { + t.end(); + }); - t.end() -}) + t.end(); +}); diff -Nru node-tape-4.9.1/test/nested-async-plan-noend.js node-tape-4.11.0/test/nested-async-plan-noend.js --- node-tape-4.9.1/test/nested-async-plan-noend.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/nested-async-plan-noend.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,33 +1,33 @@ var test = require('../'); -test('Harness async test support', function(t) { +test('Harness async test support', function (t) { t.plan(3); t.ok(true, 'sync child A'); - t.test('sync child B', function(tt) { + t.test('sync child B', function (tt) { tt.plan(2); - setTimeout(function(){ - tt.test('async grandchild A', function(ttt) { + setTimeout(function () { + tt.test('async grandchild A', function (ttt) { ttt.plan(1); ttt.ok(true); }); }, 50); - setTimeout(function() { - tt.test('async grandchild B', function(ttt) { + setTimeout(function () { + tt.test('async grandchild B', function (ttt) { ttt.plan(1); ttt.ok(true); }); }, 100); }); - setTimeout(function() { - t.test('async child', function(tt) { + setTimeout(function () { + t.test('async child', function (tt) { tt.plan(2); tt.ok(true, 'sync grandchild in async child A'); - tt.test('sync grandchild in async child B', function(ttt) { + tt.test('sync grandchild in async child B', function (ttt) { ttt.plan(1); ttt.ok(true); }); diff -Nru node-tape-4.9.1/test/nested-sync-noplan-noend.js node-tape-4.11.0/test/nested-sync-noplan-noend.js --- node-tape-4.9.1/test/nested-sync-noplan-noend.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/nested-sync-noplan-noend.js 2019-06-29 06:01:20.000000000 +0000 @@ -25,17 +25,17 @@ test.createStream().pipe(concat(tc)); - test('nested without plan or end', function(t) { - t.test('first', function(q) { + test('nested without plan or end', function (t) { + t.test('first', function (q) { setTimeout(function first() { q.ok(true); - q.end() + q.end(); }, 10); }); - t.test('second', function(q) { + t.test('second', function (q) { setTimeout(function second() { q.ok(true); - q.end() + q.end(); }, 10); }); }); diff -Nru node-tape-4.9.1/test/not-deep-equal-failure.js node-tape-4.11.0/test/not-deep-equal-failure.js --- node-tape-4.9.1/test/not-deep-equal-failure.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/not-deep-equal-failure.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,191 @@ +var tape = require('../'); +var tap = require('tap'); +var concat = require('concat-stream'); +var tapParser = require('tap-parser'); +var common = require('./common'); + +var getDiag = common.getDiag; +var stripFullStack = common.stripFullStack; + +tap.test('deep equal failure', function (assert) { + var test = tape.createHarness({ exit : false }); + var stream = test.createStream(); + var parser = tapParser(); + assert.plan(3); + + stream.pipe(parser); + stream.pipe(concat(function (body) { + assert.equal( + stripFullStack(body.toString('utf8')), + 'TAP version 13\n' + + '# not deep equal\n' + + 'not ok 1 should not be equivalent\n' + + ' ---\n' + + ' operator: notDeepEqual\n' + + ' expected: |-\n' + + ' { b: 2 }\n' + + ' actual: |-\n' + + ' { b: 2 }\n' + + ' at: Test. ($TEST/not-deep-equal-failure.js:$LINE:$COL)\n' + + ' stack: |-\n' + + ' Error: should not be equivalent\n' + + ' [... stack stripped ...]\n' + + ' at Test. ($TEST/not-deep-equal-failure.js:$LINE:$COL)\n' + + ' [... stack stripped ...]\n' + + ' ...\n' + + '\n' + + '1..1\n' + + '# tests 1\n' + + '# pass 0\n' + + '# fail 1\n' + ); + + assert.deepEqual(getDiag(body), { + operator: 'notDeepEqual', + expected: '{ b: 2 }', + actual: '{ b: 2 }' + }); + })); + + parser.once('assert', function (data) { + delete data.diag.stack; + delete data.diag.at; + assert.deepEqual(data, { + ok: false, + id: 1, + name: 'should not be equivalent', + diag: { + operator: 'notDeepEqual', + expected: '{ b: 2 }', + actual: '{ b: 2 }' + } + }); + }); + + test("not deep equal", function (t) { + t.plan(1); + t.notDeepEqual({b: 2}, {b: 2}); + }); +}); + +tap.test('not deep equal failure, depth 6, with option', function (assert) { + var test = tape.createHarness({ exit : false }); + var stream = test.createStream(); + var parser = tapParser(); + assert.plan(3); + + stream.pipe(parser); + stream.pipe(concat(function (body) { + assert.equal( + stripFullStack(body.toString('utf8')), + 'TAP version 13\n' + + '# not deep equal\n' + + 'not ok 1 should not be equivalent\n' + + ' ---\n' + + ' operator: notDeepEqual\n' + + ' expected: |-\n' + + ' { a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }\n' + + ' actual: |-\n' + + ' { a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }\n' + + ' at: Test. ($TEST/not-deep-equal-failure.js:$LINE:$COL)\n' + + ' stack: |-\n' + + ' Error: should not be equivalent\n' + + ' [... stack stripped ...]\n' + + ' at Test. ($TEST/not-deep-equal-failure.js:$LINE:$COL)\n' + + ' [... stack stripped ...]\n' + + ' ...\n' + + '\n' + + '1..1\n' + + '# tests 1\n' + + '# pass 0\n' + + '# fail 1\n' + ); + + assert.deepEqual(getDiag(body), { + operator: 'notDeepEqual', + expected: '{ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }', + actual: '{ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }' + }); + })); + + parser.once('assert', function (data) { + delete data.diag.stack; + delete data.diag.at; + assert.deepEqual(data, { + ok: false, + id: 1, + name: 'should not be equivalent', + diag: { + operator: 'notDeepEqual', + expected: '{ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }', + actual: '{ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }' + } + }); + }); + + test("not deep equal", {objectPrintDepth: 6}, function (t) { + t.plan(1); + t.notDeepEqual({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }); + }); +}); + +tap.test('not deep equal failure, depth 6, without option', function (assert) { + var test = tape.createHarness({ exit : false }); + var stream = test.createStream(); + var parser = tapParser(); + assert.plan(3); + + stream.pipe(parser); + stream.pipe(concat(function (body) { + assert.equal( + stripFullStack(body.toString('utf8')), + 'TAP version 13\n' + + '# not deep equal\n' + + 'not ok 1 should not be equivalent\n' + + ' ---\n' + + ' operator: notDeepEqual\n' + + ' expected: |-\n' + + ' { a: { a1: { a2: { a3: { a4: [Object] } } } } }\n' + + ' actual: |-\n' + + ' { a: { a1: { a2: { a3: { a4: [Object] } } } } }\n' + + ' at: Test. ($TEST/not-deep-equal-failure.js:$LINE:$COL)\n' + + ' stack: |-\n' + + ' Error: should not be equivalent\n' + + ' [... stack stripped ...]\n' + + ' at Test. ($TEST/not-deep-equal-failure.js:$LINE:$COL)\n' + + ' [... stack stripped ...]\n' + + ' ...\n' + + '\n' + + '1..1\n' + + '# tests 1\n' + + '# pass 0\n' + + '# fail 1\n' + ); + + assert.deepEqual(getDiag(body), { + operator: 'notDeepEqual', + expected: '{ a: { a1: { a2: { a3: { a4: [Object] } } } } }', + actual: '{ a: { a1: { a2: { a3: { a4: [Object] } } } } }' + }); + })); + + parser.once('assert', function (data) { + delete data.diag.stack; + delete data.diag.at; + assert.deepEqual(data, { + ok: false, + id: 1, + name: 'should not be equivalent', + diag: { + operator: 'notDeepEqual', + expected: '{ a: { a1: { a2: { a3: { a4: [Object] } } } } }', + actual: '{ a: { a1: { a2: { a3: { a4: [Object] } } } } }' + } + }); + }); + + test("not deep equal", function (t) { + t.plan(1); + t.notDeepEqual({ a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }, { a: { a1: { a2: { a3: { a4: { a5: 1 } } } } } }); + }); +}); diff -Nru node-tape-4.9.1/test/not-equal-failure.js node-tape-4.11.0/test/not-equal-failure.js --- node-tape-4.9.1/test/not-equal-failure.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/not-equal-failure.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,67 @@ +var tape = require('../'); +var tap = require('tap'); +var concat = require('concat-stream'); +var tapParser = require('tap-parser'); +var common = require('./common'); + +var getDiag = common.getDiag; +var stripFullStack = common.stripFullStack; + +tap.test('not equal failure', function (assert) { + var test = tape.createHarness({ exit : false }); + var stream = test.createStream(); + var parser = tapParser(); + assert.plan(3); + + stream.pipe(parser); + stream.pipe(concat(function (body) { + assert.equal( + stripFullStack(body.toString('utf8')), + 'TAP version 13\n' + + '# not equal\n' + + 'not ok 1 should not be equal\n' + + ' ---\n' + + ' operator: notEqual\n' + + ' expected: 2\n' + + ' actual: 2\n' + + ' at: Test. ($TEST/not-equal-failure.js:$LINE:$COL)\n' + + ' stack: |-\n' + + ' Error: should not be equal\n' + + ' [... stack stripped ...]\n' + + ' at Test. ($TEST/not-equal-failure.js:$LINE:$COL)\n' + + ' [... stack stripped ...]\n' + + ' ...\n' + + '\n' + + '1..1\n' + + '# tests 1\n' + + '# pass 0\n' + + '# fail 1\n' + ); + + assert.deepEqual(getDiag(body), { + operator: 'notEqual', + expected: '2', + actual: '2' + }); + })); + + parser.once('assert', function (data) { + delete data.diag.stack; + delete data.diag.at; + assert.deepEqual(data, { + ok: false, + id: 1, + name: 'should not be equal', + diag: { + operator: 'notEqual', + expected: '2', + actual: '2' + } + }); + }); + + test("not equal", function (t) { + t.plan(1); + t.notEqual(2, 2); + }); +}); diff -Nru node-tape-4.9.1/test/objectMode.js node-tape-4.11.0/test/objectMode.js --- node-tape-4.9.1/test/objectMode.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/objectMode.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,70 @@ +var tap = require('tap'); +var tape = require('../'); +var forEach = require('for-each'); +var through = require('through'); + +tap.test('object results', function (assert) { + var printer = through({ objectMode: true }); + var objects = []; + + printer.write = function (obj) { + objects.push(obj); + }; + + printer.end = function (obj) { + if (obj) objects.push(obj); + + var todos = 0; + var skips = 0; + var testIds = []; + var endIds = []; + var asserts = 0; + + assert.equal(objects.length, 13); + + forEach(objects, function (obj) { + if (obj.type === 'assert') { + asserts++; + } else if (obj.type === 'test') { + testIds.push(obj.id); + + if (obj.skip) { + skips++; + } else if (obj.todo) { + todos++; + } + } else if (obj.type === 'end') { + endIds.push(obj.text); + // test object should exist + assert.notEqual(testIds.indexOf(obj.test), -1); + } + }); + + assert.equal(asserts, 5); + assert.equal(skips, 1); + assert.equal(todos, 2); + assert.equal(testIds.length, endIds.length); + assert.end(); + }; + + tape.createStream({ objectMode: true }) + .pipe(printer); + + tape('parent', function (t1) { + t1.equal(true, true); + t1.test('child1', {skip: true}, function (t2) { + t2.equal(true, true); + t2.equal(true, false); + t2.end(); + }); + t1.test('child2', {todo: true}, function (t3) { + t3.equal(true, false); + t3.equal(true, true); + t3.end(); + }); + t1.test('child3', {todo: true}); + t1.equal(true, true); + t1.equal(true, true); + t1.end(); + }); +}); diff -Nru node-tape-4.9.1/test/onFailure.js node-tape-4.11.0/test/onFailure.js --- node-tape-4.9.1/test/onFailure.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/onFailure.js 2019-06-29 06:01:20.000000000 +0000 @@ -3,19 +3,19 @@ //Because this test passing depends on a failure, //we must direct the failing output of the inner test -var noop = function(){} -var mockSink = {on:noop, removeListener:noop, emit:noop, end:noop} +var noop = function () {}; +var mockSink = {on:noop, removeListener:noop, emit:noop, end:noop}; tape.createStream().pipe(mockSink); -tap.test("on failure", { timeout: 1000 }, function(tt) { +tap.test("on failure", { timeout: 1000 }, function (tt) { tt.plan(1); - tape("dummy test", function(t) { + tape("dummy test", function (t) { t.fail(); t.end(); }); - tape.onFailure(function() { + tape.onFailure(function () { tt.pass("tape ended"); }); }); diff -Nru node-tape-4.9.1/test/onFinish.js node-tape-4.11.0/test/onFinish.js --- node-tape-4.9.1/test/onFinish.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/onFinish.js 2019-06-29 06:01:20.000000000 +0000 @@ -3,10 +3,10 @@ tap.test("on finish", {timeout: 1000}, function (tt) { tt.plan(1); - tape.onFinish(function() { + tape.onFinish(function () { tt.pass('tape ended'); }); - tape('dummy test', function(t) { + tape('dummy test', function (t) { t.end(); }); }); diff -Nru node-tape-4.9.1/test/only.js node-tape-4.11.0/test/only.js --- node-tape-4.9.1/test/only.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/only.js 2019-06-29 06:01:20.000000000 +0000 @@ -20,26 +20,26 @@ ].join('\n') + '\n'); tt.deepEqual(ran, [ 3 ]); - tt.end() + tt.end(); }; test.createStream().pipe(concat(tc)); test("never run fail", function (t) { ran.push(1); - t.equal(true, false) - t.end() - }) + t.equal(true, false); + t.end(); + }); test("never run success", function (t) { ran.push(2); - t.equal(true, true) - t.end() - }) + t.equal(true, true); + t.end(); + }); test.only("run success", function (t) { ran.push(3); - t.ok(true, "assert name") - t.end() - }) -}) + t.ok(true, "assert name"); + t.end(); + }); +}); diff -Nru node-tape-4.9.1/test/only-twice.js node-tape-4.11.0/test/only-twice.js --- node-tape-4.9.1/test/only-twice.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/only-twice.js 2019-06-29 06:01:20.000000000 +0000 @@ -5,11 +5,11 @@ var test = tape.createHarness({ exit : false }); test.only("first only", function (t) { - t.end() + t.end(); }); - assert.throws(function() { - test.only('second only', function(t) { + assert.throws(function () { + test.only('second only', function (t) { t.end(); }); }, { diff -Nru node-tape-4.9.1/test/plan_optional.js node-tape-4.11.0/test/plan_optional.js --- node-tape-4.9.1/test/plan_optional.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/plan_optional.js 2019-06-29 06:01:20.000000000 +0000 @@ -6,7 +6,7 @@ }); test('no plan async', function (t) { - setTimeout(function() { + setTimeout(function () { t.pass('ok'); t.end(); }, 100); diff -Nru node-tape-4.9.1/test/require/a.js node-tape-4.11.0/test/require/a.js --- node-tape-4.9.1/test/require/a.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/require/a.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,8 +1,8 @@ var tape = require('../..'); -tape.test('module-a', function(t) { - t.plan(1) - t.pass('loaded module a') -}) +tape.test('module-a', function (t) { + t.plan(1); + t.pass('loaded module a'); +}); -global.module_a = true +global.module_a = true; diff -Nru node-tape-4.9.1/test/require/b.js node-tape-4.11.0/test/require/b.js --- node-tape-4.9.1/test/require/b.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/require/b.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,8 +1,8 @@ var tape = require('../..'); -tape.test('module-b', function(t) { - t.plan(1) - t.pass('loaded module b') -}) +tape.test('module-b', function (t) { + t.plan(1); + t.pass('loaded module b'); +}); -global.module_b = true +global.module_b = true; diff -Nru node-tape-4.9.1/test/require/test-a.js node-tape-4.11.0/test/require/test-a.js --- node-tape-4.9.1/test/require/test-a.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/require/test-a.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,7 +1,7 @@ var tape = require('../..'); -tape.test('test-a', function(t) { - t.ok(global.module_a, 'module-a loaded in same context') - t.pass('test ran after module-a was loaded') - t.end() -}) +tape.test('test-a', function (t) { + t.ok(global.module_a, 'module-a loaded in same context'); + t.pass('test ran after module-a was loaded'); + t.end(); +}); diff -Nru node-tape-4.9.1/test/require/test-b.js node-tape-4.11.0/test/require/test-b.js --- node-tape-4.9.1/test/require/test-b.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/require/test-b.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,7 +1,7 @@ var tape = require('../..'); -tape.test('test-b', function(t) { - t.ok(global.module_b, 'module-b loaded in same context') - t.pass('test ran after module-b was loaded') - t.end() -}) +tape.test('test-b', function (t) { + t.ok(global.module_b, 'module-b loaded in same context'); + t.pass('test ran after module-b was loaded'); + t.end(); +}); diff -Nru node-tape-4.9.1/test/require.js node-tape-4.11.0/test/require.js --- node-tape-4.9.1/test/require.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/require.js 2019-06-29 06:01:20.000000000 +0000 @@ -62,8 +62,8 @@ }); function tape(args) { - var proc = require('child_process') - var bin = __dirname + '/../bin/tape' + var proc = require('child_process'); + var bin = __dirname + '/../bin/tape'; - return proc.spawn('node', [bin].concat(args.split(' ')), { cwd: __dirname }) + return proc.spawn('node', [bin].concat(args.split(' ')), { cwd: __dirname }); } diff -Nru node-tape-4.9.1/test/skip_explanation.js node-tape-4.11.0/test/skip_explanation.js --- node-tape-4.9.1/test/skip_explanation.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/skip_explanation.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,82 @@ +var tap = require('tap'); +var test = require('../'); +var concat = require('concat-stream'); +var stripFullStack = require('./common').stripFullStack; + +tap.test('test skip explanations', function (assert) { + assert.plan(1); + + var verify = function (output) { + assert.equal(stripFullStack(output.toString('utf8')), [ + 'TAP version 13', + '# SKIP (this skips)', + '# some tests might skip', + 'ok 1 this runs', + 'ok 2 failing assert is skipped # SKIP', + 'ok 3 this runs', + '# incomplete test', + 'ok 4 run sh', + 'ok 5 run openssl # SKIP', + '# incomplete test with explanation', + 'ok 6 run sh (conditional skip) # SKIP', + 'ok 7 run openssl # SKIP can\'t run on windows platforms', + 'ok 8 this runs', + '# too much explanation', + 'ok 9 run openssl # SKIP Installer cannot work on windows and fails to add to PATH Err: (2401) denied', + '', + '1..9', + '# tests 9', + '# pass 9', + '', + '# ok', + '' + ].join('\n')); + }; + + var tapeTest = test.createHarness(); + tapeTest.createStream().pipe(concat(verify)); + + tapeTest('(this skips)', { skip: true }, function (t) { + t.fail('doesn\'t run'); + t.fail('this doesn\'t run too', { skip: false }); + t.end(); + }); + + tapeTest('some tests might skip', function (t) { + t.pass('this runs'); + t.fail('failing assert is skipped', { skip: true }); + t.pass('this runs'); + t.end(); + }); + + tapeTest('incomplete test', function (t) { + // var platform = process.platform; something like this needed + var platform = 'win32'; + + t.pass('run sh', { skip: platform !== 'win32' }); + t.pass('run openssl', { skip: platform === 'win32' }); + t.end(); + }); + + tapeTest('incomplete test with explanation', function (t) { + // var platform = process.platform; something like this needed + var platform = 'win32'; + + t.fail('run sh (conditional skip)', { skip: platform === 'win32' }); + t.fail('run openssl', { skip: platform === 'win32' && 'can\'t run on windows platforms' }); + t.pass('this runs'); + t.end(); + }); + + tapeTest('too much explanation', function (t) { + // var platform = process.platform; something like this needed + var platform = 'win32'; + + t.fail('run openssl', + { skip: platform === 'win32' && 'Installer cannot work on windows\nand fails to add to PATH\n\n Err: (2401) denied' } + ); + t.end(); + }); +}); + +// vim: set softtabstop=4 shiftwidth=4: diff -Nru node-tape-4.9.1/test/skip.js node-tape-4.11.0/test/skip.js --- node-tape-4.9.1/test/skip.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/skip.js 2019-06-29 06:01:20.000000000 +0000 @@ -28,21 +28,21 @@ }); }); -test('skip this', { skip: true }, function(t) { +test('skip this', { skip: true }, function (t) { t.fail('this should not even run'); ran++; t.end(); }); -test.skip('skip this too', function(t) { +test.skip('skip this too', function (t) { t.fail('this should not even run'); ran++; t.end(); }); -test('skip subtest', function(t) { +test('skip subtest', function (t) { ran++; - t.test('skip this', { skip: true }, function(t) { + t.test('skip this', { skip: true }, function (t) { t.fail('this should not even run'); t.end(); }); diff -Nru node-tape-4.9.1/test/stackTrace.js node-tape-4.11.0/test/stackTrace.js --- node-tape-4.9.1/test/stackTrace.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/stackTrace.js 2019-06-29 06:01:20.000000000 +0000 @@ -76,7 +76,7 @@ test._results._watch = function (t) { t.on('result', function (res) { - tt.equal('Test.testFunctionNameParsing', res.functionName) + tt.equal('Test.testFunctionNameParsing', res.functionName); }); }; @@ -94,7 +94,7 @@ test._results._watch = function (t) { t.on('result', function (res) { - tt.equal('Test.', res.functionName) + tt.equal('Test.', res.functionName); }); }; @@ -111,13 +111,13 @@ var stream = test.createStream(); var parser = stream.pipe(tapParser()); - var stack = '' + var stack = ''; parser.once('assert', function (data) { tt.equal(typeof data.diag.at, 'string'); tt.equal(typeof data.diag.stack, 'string'); at = data.diag.at || ''; stack = data.diag.stack || ''; - tt.ok(/^Error: true should be false(\n at .+)+/.exec(stack), 'stack should be a stack') + tt.ok(/^Error: true should be false(\n at .+)+/.exec(stack), 'stack should be a stack'); tt.deepEqual(data, { ok: false, id: 1, @@ -176,13 +176,13 @@ var stream = test.createStream(); var parser = stream.pipe(tapParser()); - var stack = '' + var stack = ''; parser.once('assert', function (data) { tt.equal(typeof data.diag.at, 'string'); tt.equal(typeof data.diag.stack, 'string'); at = data.diag.at || ''; stack = data.diag.stack || ''; - tt.ok(/^Error: false should be true(\n at .+)+/.exec(stack), 'stack should be a stack') + tt.ok(/^Error: false should be true(\n at .+)+/.exec(stack), 'stack should be a stack'); tt.deepEqual(data, { ok: false, id: 1, @@ -234,7 +234,7 @@ }); }); -function getDiag (body) { +function getDiag(body) { var yamlStart = body.indexOf(' ---'); var yamlEnd = body.indexOf(' ...\n'); var diag = body.slice(yamlStart, yamlEnd).split('\n').map(function (line) { @@ -248,6 +248,6 @@ return withStack; } -function stripAt (body) { +function stripAt(body) { return body.replace(/^\s*at:\s+Test.*$\n/m, ''); } diff -Nru node-tape-4.9.1/test/subcount.js node-tape-4.11.0/test/subcount.js --- node-tape-4.9.1/test/subcount.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/subcount.js 2019-06-29 06:01:20.000000000 +0000 @@ -5,10 +5,10 @@ t.test('first child', function (t) { t.plan(1); t.pass('pass first child'); - }) + }); t.test(function (t) { t.plan(1); t.pass('pass second child'); - }) -}) + }); +}); diff -Nru node-tape-4.9.1/test/subtest_and_async.js node-tape-4.11.0/test/subtest_and_async.js --- node-tape-4.9.1/test/subtest_and_async.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/subtest_and_async.js 2019-06-29 06:01:20.000000000 +0000 @@ -5,19 +5,21 @@ }; test('master test', function (t) { - t.test('subtest 1', function (t) { - t.pass('subtest 1 before async call'); + t.test('subtest 1', function (st) { + st.pass('subtest 1 before async call'); asyncFunction(function () { - t.pass('subtest 1 in async callback'); - t.end(); - }) + st.pass('subtest 1 in async callback'); + st.end(); + }); }); - t.test('subtest 2', function (t) { - t.pass('subtest 2 before async call'); + t.test('subtest 2', function (st) { + st.pass('subtest 2 before async call'); asyncFunction(function () { - t.pass('subtest 2 in async callback'); - t.end(); - }) + st.pass('subtest 2 in async callback'); + st.end(); + }); }); + + t.end(); }); diff -Nru node-tape-4.9.1/test/subtest_plan.js node-tape-4.11.0/test/subtest_plan.js --- node-tape-4.9.1/test/subtest_plan.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/subtest_plan.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,7 +1,7 @@ var test = require('../'); test('parent', function (t) { - t.plan(3) + t.plan(3); var firstChildRan = false; diff -Nru node-tape-4.9.1/test/timeout.js node-tape-4.11.0/test/timeout.js --- node-tape-4.9.1/test/timeout.js 2018-06-07 23:03:18.000000000 +0000 +++ node-tape-4.11.0/test/timeout.js 2019-06-29 06:01:20.000000000 +0000 @@ -1,7 +1,7 @@ var test = require('../'); var ran = 0; -test('timeout', function(t) { +test('timeout', function (t) { t.pass('this should run'); ran++; setTimeout(function () { @@ -9,7 +9,7 @@ }, 100); }); -test('should still run', { timeout: 50 }, function(t) { +test('should still run', { timeout: 50 }, function (t) { t.equal(ran, 1); t.end(); }); diff -Nru node-tape-4.9.1/test/todo_explanation.js node-tape-4.11.0/test/todo_explanation.js --- node-tape-4.9.1/test/todo_explanation.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/todo_explanation.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,70 @@ +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', { todo: process.versions.node.match(/0\.8\.\d+/) ? 'Fails on node 0.8': false }, 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', + '# success', + 'ok 1 this test runs', + '# TODO incomplete test1', + 'not ok 2 check output # TODO', + ' ---', + ' operator: equal', + ' expected: false', + ' actual: true', + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', + ' ...', + 'not ok 3 check vars output # TODO name conflict', + ' ---', + ' operator: equal', + ' expected: 0', + ' actual: 1', + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', + ' ...', + '# incomplete test2', + 'not ok 4 run openssl # TODO installer needs fix', + ' ---', + ' operator: fail', + ' at: Test. ($TEST/todo_explanation.js:$LINE:$COL)', + ' ...', + '# TODO passing test', + '', + '1..4', + '# tests 4', + '# pass 4', + '', + '# ok', + '' + ].join('\n') + ); + })); + + test('success', function (t) { + t.equal(true, true, 'this test runs'); + t.end(); + }); + + test('incomplete test1', { todo: true }, function (t) { + t.equal(true, false, 'check output'); + t.equal(1, 0, 'check vars output', { todo: 'name conflict' }); + t.end(); + }); + + test('incomplete test2', function (t) { + t.fail('run openssl', { todo: 'installer needs fix' }); + t.end(); + }); + + test('passing test', { todo: 'yet incomplete' }, function (t) { + t.end(); + }); +}); diff -Nru node-tape-4.9.1/test/todo.js node-tape-4.11.0/test/todo.js --- node-tape-4.9.1/test/todo.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/todo.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,42 @@ +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 failure\n' + + 'not ok 2 should never happen # TODO\n' + + ' ---\n' + + ' operator: fail\n' + + ' at: Test. ($TEST/todo.js:$LINE:$COL)\n' + + ' ...\n' + + '\n' + + '1..2\n' + + '# tests 2\n' + + '# pass 2\n' + + '\n' + + '# ok\n' + ); + })); + + test('success', function (t) { + t.equal(true, true, 'this test runs'); + t.end(); + }); + + test('failure', { todo: true }, function (t) { + t.fail('should never happen'); + t.end(); + }); +}); diff -Nru node-tape-4.9.1/test/todo_single.js node-tape-4.11.0/test/todo_single.js --- node-tape-4.9.1/test/todo_single.js 1970-01-01 00:00:00.000000000 +0000 +++ node-tape-4.11.0/test/todo_single.js 2019-06-29 06:01:20.000000000 +0000 @@ -0,0 +1,37 @@ +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' + + '# TODO failure\n' + + 'not ok 1 should be equal # TODO\n' + + ' ---\n' + + ' operator: equal\n' + + ' expected: false\n' + + ' actual: true\n' + + ' at: Test. ($TEST/todo_single.js:$LINE:$COL)\n' + + ' ...\n' + + '\n' + + '1..1\n' + + '# tests 1\n' + + '# pass 1\n' + + '\n' + + '# ok\n' + ); + })); + + test('failure', { todo: true }, function (t) { + t.equal(true, false); + t.end(); + }); +});