Comparing version
@@ -11,2 +11,3 @@ 'use strict'; | ||
var trim = require('string.prototype.trim'); | ||
var callBind = require('call-bind'); | ||
var callBound = require('call-bind/callBound'); | ||
@@ -92,11 +93,7 @@ var forEach = require('for-each'); | ||
for (var prop in this) { | ||
this[prop] = (function bind(self, val) { | ||
if (typeof val === 'function') { | ||
return function bound() { | ||
return val.apply(self, arguments); | ||
}; | ||
} | ||
return val; | ||
}(this, this[prop])); | ||
var self = this; | ||
for (var prop in self) { | ||
if (typeof self[prop] === 'function') { | ||
self[prop] = callBind(self[prop], self); | ||
} | ||
} | ||
@@ -103,0 +100,0 @@ } |
{ | ||
"name": "tape", | ||
"version": "5.6.3", | ||
"version": "5.6.4", | ||
"description": "tap-producing test harness for node and browsers", | ||
@@ -30,3 +30,3 @@ "main": "index.js", | ||
"call-bind": "^1.0.2", | ||
"deep-equal": "^2.2.0", | ||
"deep-equal": "^2.2.1", | ||
"defined": "^1.0.1", | ||
@@ -41,3 +41,3 @@ "dotignore": "^0.1.2", | ||
"is-regex": "^1.1.4", | ||
"minimist": "^1.2.7", | ||
"minimist": "^1.2.8", | ||
"object-inspect": "^1.12.3", | ||
@@ -53,5 +53,5 @@ "object-is": "^1.1.5", | ||
"devDependencies": { | ||
"@ljharb/eslint-config": "^21.0.1", | ||
"@ljharb/eslint-config": "^21.1.0", | ||
"array.prototype.flatmap": "^1.3.1", | ||
"aud": "^2.0.2", | ||
"aud": "^2.0.3", | ||
"auto-changelog": "^2.4.0", | ||
@@ -64,2 +64,3 @@ "concat-stream": "^1.6.2", | ||
"falafel": "^2.2.5", | ||
"jackspeak": "=2.1.1", | ||
"js-yaml": "^3.14.0", | ||
@@ -66,0 +67,0 @@ "npm-run-posix-or-windows": "^2.0.2", |
@@ -213,5 +213,3 @@ 'use strict'; | ||
' at Test.myTest ($TEST/async-await/sync-error.js:$LINE:$COL)', | ||
' at Test.bound [as _cb] ($TAPE/lib/test.js:$LINE:$COL)', | ||
' at Test.run ($TAPE/lib/test.js:$LINE:$COL)', | ||
' at Test.bound [as run] ($TAPE/lib/test.js:$LINE:$COL)', | ||
node17 ? [ | ||
@@ -218,0 +216,0 @@ '', |
@@ -11,8 +11,8 @@ 'use strict'; | ||
var expectedExitCodeFailure = (/^0\.10\.\d+$/).test(process.versions.node); | ||
var expectedStackTraceBug = (/^3\.[012]\.\d+$/).test(process.versions.node); // https://github.com/nodejs/node/issues/2581 | ||
var expectedExitCodeOnError = (/^0\.(?:9|10)/).test(process.versions.node) ? 8 : 1; // node v0.9 sets this exit code to 8, for some reason | ||
tap.test( | ||
'Should throw error when --no-only is passed via cli and there is a .only test', | ||
{ todo: expectedExitCodeFailure || expectedStackTraceBug ? 'Fails on these node versions' : false }, | ||
{ todo: expectedStackTraceBug ? 'Fails on these node versions' : false }, | ||
function (tt) { | ||
@@ -26,3 +26,3 @@ tt.plan(3); | ||
tt.match(stripFullStack(stderr.toString('utf8')).join('\n'), /Error: `only` tests are prohibited\n/); | ||
tt.equal(err.code, 1); | ||
tt.equal(err.code, expectedExitCodeOnError); | ||
}); | ||
@@ -34,3 +34,3 @@ } | ||
'Should throw error when NODE_TAPE_NO_ONLY_TEST is passed via envs and there is an .only test', | ||
{ todo: expectedExitCodeFailure || expectedStackTraceBug ? 'Fails on these node versions' : false }, | ||
{ todo: expectedStackTraceBug ? 'Fails on these node versions' : false }, | ||
function (tt) { | ||
@@ -45,3 +45,3 @@ tt.plan(3); | ||
tt.match(stripFullStack(stderr.toString('utf8')).join('\n'), /Error: `only` tests are prohibited\n/); | ||
tt.equal(err.code, 1); | ||
tt.equal(err.code, expectedExitCodeOnError); | ||
}); | ||
@@ -53,3 +53,3 @@ } | ||
'Should override NODE_TAPE_NO_ONLY_TEST env if --no-only is passed from cli', | ||
{ todo: expectedExitCodeFailure || expectedStackTraceBug ? 'Fails on these node versions' : false }, | ||
{ todo: expectedStackTraceBug ? 'Fails on these node versions' : false }, | ||
function (tt) { | ||
@@ -64,3 +64,3 @@ tt.plan(3); | ||
tt.match(stripFullStack(stderr.toString('utf8')).join('\n'), /Error: `only` tests are prohibited\n/); | ||
tt.equal(err.code, 1); | ||
tt.equal(err.code, expectedExitCodeOnError); | ||
}); | ||
@@ -67,0 +67,0 @@ } |
@@ -43,2 +43,4 @@ 'use strict'; | ||
' [... stack stripped ...]', | ||
' at Test.<anonymous> ($TEST/teardown.js:$LINE:$COL)', | ||
' [... stack stripped ...]', | ||
' ...', | ||
@@ -45,0 +47,0 @@ '# nested teardown (nested fail level)', |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
366520
0.88%17
6.25%6831
-0.04%Updated
Updated