Comparing version 4.12.1 to 4.13.0
185
lib/test.js
@@ -11,4 +11,6 @@ var deepEqual = require('deep-equal'); | ||
var forEach = require('for-each'); | ||
var inspect = require('object-inspect'); | ||
var isEnumerable = bind.call(Function.call, Object.prototype.propertyIsEnumerable); | ||
var toLowerCase = bind.call(Function.call, String.prototype.toLowerCase); | ||
var $test = bind.call(Function.call, RegExp.prototype.test); | ||
@@ -173,4 +175,4 @@ module.exports = Test; | ||
this.fail('plan != count', { | ||
expected : this._plan, | ||
actual : this.assertCount | ||
expected: this._plan, | ||
actual: this.assertCount | ||
}); | ||
@@ -186,5 +188,5 @@ } | ||
this.fail('plan != count', { | ||
expected : this._plan, | ||
actual : this.assertCount, | ||
exiting : true | ||
expected: this._plan, | ||
actual: this.assertCount, | ||
exiting: true | ||
}); | ||
@@ -316,4 +318,4 @@ } else if (!this.ended) { | ||
self.fail('plan != count', { | ||
expected : self._plan, | ||
actual : self._plan - pendingAsserts | ||
expected: self._plan, | ||
actual: self._plan - pendingAsserts | ||
}); | ||
@@ -325,5 +327,5 @@ } | ||
this._assert(false, { | ||
message : msg, | ||
operator : 'fail', | ||
extra : extra | ||
message: msg, | ||
operator: 'fail', | ||
extra: extra | ||
}); | ||
@@ -334,5 +336,5 @@ }; | ||
this._assert(true, { | ||
message : msg, | ||
operator : 'pass', | ||
extra : extra | ||
message: msg, | ||
operator: 'pass', | ||
extra: extra | ||
}); | ||
@@ -343,6 +345,6 @@ }; | ||
this._assert(true, { | ||
message : msg, | ||
operator : 'skip', | ||
skip : true, | ||
extra : extra | ||
message: msg, | ||
operator: 'skip', | ||
skip: true, | ||
extra: extra | ||
}); | ||
@@ -353,7 +355,7 @@ }; | ||
this._assert(value, { | ||
message : defined(msg, 'should be truthy'), | ||
operator : 'ok', | ||
expected : true, | ||
actual : value, | ||
extra : extra | ||
message: defined(msg, 'should be truthy'), | ||
operator: 'ok', | ||
expected: true, | ||
actual: value, | ||
extra: extra | ||
}); | ||
@@ -368,7 +370,7 @@ } | ||
this._assert(!value, { | ||
message : defined(msg, 'should be falsy'), | ||
operator : 'notOk', | ||
expected : false, | ||
actual : value, | ||
extra : extra | ||
message: defined(msg, 'should be falsy'), | ||
operator: 'notOk', | ||
expected: false, | ||
actual: value, | ||
extra: extra | ||
}); | ||
@@ -383,6 +385,6 @@ } | ||
this._assert(!err, { | ||
message : defined(msg, String(err)), | ||
operator : 'error', | ||
actual : err, | ||
extra : extra | ||
message: defined(msg, String(err)), | ||
operator: 'error', | ||
actual: err, | ||
extra: extra | ||
}); | ||
@@ -398,7 +400,7 @@ } | ||
this._assert(a === b, { | ||
message : defined(msg, 'should be equal'), | ||
operator : 'equal', | ||
actual : a, | ||
expected : b, | ||
extra : extra | ||
message: defined(msg, 'should be equal'), | ||
operator: 'equal', | ||
actual: a, | ||
expected: b, | ||
extra: extra | ||
}); | ||
@@ -416,7 +418,7 @@ } | ||
this._assert(a !== b, { | ||
message : defined(msg, 'should not be equal'), | ||
operator : 'notEqual', | ||
actual : a, | ||
expected : b, | ||
extra : extra | ||
message: defined(msg, 'should not be equal'), | ||
operator: 'notEqual', | ||
actual: a, | ||
expected: b, | ||
extra: extra | ||
}); | ||
@@ -437,7 +439,7 @@ } | ||
this._assert(deepEqual(a, b, { strict: true }), { | ||
message : defined(msg, 'should be equivalent'), | ||
operator : 'deepEqual', | ||
actual : a, | ||
expected : b, | ||
extra : extra | ||
message: defined(msg, 'should be equivalent'), | ||
operator: 'deepEqual', | ||
actual: a, | ||
expected: b, | ||
extra: extra | ||
}); | ||
@@ -453,7 +455,7 @@ } | ||
this._assert(deepEqual(a, b), { | ||
message : defined(msg, 'should be equivalent'), | ||
operator : 'deepLooseEqual', | ||
actual : a, | ||
expected : b, | ||
extra : extra | ||
message: defined(msg, 'should be equivalent'), | ||
operator: 'deepLooseEqual', | ||
actual: a, | ||
expected: b, | ||
extra: extra | ||
}); | ||
@@ -468,7 +470,7 @@ } | ||
this._assert(!deepEqual(a, b, { strict: true }), { | ||
message : defined(msg, 'should not be equivalent'), | ||
operator : 'notDeepEqual', | ||
actual : a, | ||
expected : b, | ||
extra : extra | ||
message: defined(msg, 'should not be equivalent'), | ||
operator: 'notDeepEqual', | ||
actual: a, | ||
expected: b, | ||
extra: extra | ||
}); | ||
@@ -489,7 +491,7 @@ } | ||
this._assert(!deepEqual(a, b), { | ||
message : defined(msg, 'should be equivalent'), | ||
operator : 'notDeepLooseEqual', | ||
actual : a, | ||
expected : b, | ||
extra : extra | ||
message: defined(msg, 'should be equivalent'), | ||
operator: 'notDeepLooseEqual', | ||
actual: a, | ||
expected: b, | ||
extra: extra | ||
}); | ||
@@ -513,3 +515,3 @@ } | ||
} catch (err) { | ||
caught = { error : err }; | ||
caught = { error: err }; | ||
if ((err != null) && (!isEnumerable(err, 'message') || !has(err, 'message'))) { | ||
@@ -534,8 +536,8 @@ var message = err.message; | ||
this._assert(typeof fn === 'function' && passed, { | ||
message : defined(msg, 'should throw'), | ||
operator : 'throws', | ||
actual : caught && caught.error, | ||
expected : expected, | ||
message: defined(msg, 'should throw'), | ||
operator: 'throws', | ||
actual: caught && caught.error, | ||
expected: expected, | ||
error: !passed && caught && caught.error, | ||
extra : extra | ||
extra: extra | ||
}); | ||
@@ -554,14 +556,49 @@ }; | ||
catch (err) { | ||
caught = { error : err }; | ||
caught = { error: err }; | ||
} | ||
this._assert(!caught, { | ||
message : defined(msg, 'should not throw'), | ||
operator : 'throws', | ||
actual : caught && caught.error, | ||
expected : expected, | ||
error : caught && caught.error, | ||
extra : extra | ||
message: defined(msg, 'should not throw'), | ||
operator: 'throws', | ||
actual: caught && caught.error, | ||
expected: expected, | ||
error: caught && caught.error, | ||
extra: extra | ||
}); | ||
}; | ||
Test.prototype.match = function match(string, regexp, msg, extra) { | ||
if (!isRegExp(regexp)) { | ||
throw new TypeError('The "regexp" argument must be an instance of RegExp. Received type ' + typeof regexp + ' (' + inspect(regexp) + ')'); | ||
} | ||
if (typeof string !== 'string') { | ||
throw new TypeError('The "string" argument must be of type string. Received type ' + typeof string + ' (' + inspect(string) + ')'); | ||
} | ||
var matches = $test(regexp, string); | ||
this._assert(matches, { | ||
message: defined(msg, 'The input did not match the regular expression ' + inspect(regexp) + '. Input: ' + inspect(string)), | ||
operator: 'match', | ||
actual: string, | ||
expected: regexp, | ||
extra: extra | ||
}); | ||
}; | ||
Test.prototype.doesNotMatch = function doesNotMatch(string, regexp, msg, extra) { | ||
if (!isRegExp(regexp)) { | ||
throw new TypeError('The "regexp" argument must be an instance of RegExp. Received type ' + typeof regexp + ' (' + inspect(regexp) + ')'); | ||
} | ||
if (typeof string !== 'string') { | ||
throw new TypeError('The "string" argument must be of type string. Received type ' + typeof string + ' (' + inspect(string) + ')'); | ||
} | ||
var matches = $test(regexp, string); | ||
this._assert(!matches, { | ||
message: defined(msg, 'The input was expected to not match the regular expression ' + inspect(regexp) + '. Input: ' + inspect(string)), | ||
operator: 'doesNotMatch', | ||
actual: string, | ||
expected: regexp, | ||
extra: extra | ||
}); | ||
}; | ||
Test.skip = function (name_, _opts, _cb) { | ||
@@ -568,0 +605,0 @@ var args = getTestArgs.apply(null, arguments); |
{ | ||
"name": "tape", | ||
"version": "4.12.1", | ||
"version": "4.13.0", | ||
"description": "tap-producing test harness for node and browsers", | ||
@@ -14,2 +14,3 @@ "main": "index.js", | ||
"defined": "~1.0.0", | ||
"dotignore": "~0.1.2", | ||
"for-each": "~0.3.3", | ||
@@ -23,3 +24,3 @@ "function-bind": "~1.1.1", | ||
"object-inspect": "~1.7.0", | ||
"resolve": "~1.14.1", | ||
"resolve": "~1.14.2", | ||
"resumer": "~0.0.0", | ||
@@ -26,0 +27,0 @@ "string.prototype.trim": "~1.2.1", |
@@ -15,8 +15,2 @@ var tape = require('../'); | ||
// Handle stack trace variation in Node v0.8 | ||
body = body.replace( | ||
/at(:?) Test\.module\.exports/g, | ||
'at$1 Test.<anonymous>' | ||
); | ||
tt.same(body, [ | ||
@@ -23,0 +17,0 @@ 'TAP version 13', |
@@ -8,3 +8,3 @@ var tape = require('../'); | ||
tap.test('circular test', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
assert.plan(1); | ||
@@ -11,0 +11,0 @@ |
@@ -60,3 +60,7 @@ var path = require('path'); | ||
return deduped.join('\n'); | ||
return deduped.join('\n').replace( | ||
// Handle stack trace variation in Node v0.8 | ||
/at(:?) Test\.(?:module\.exports|tap\.test\.err\.code)/g, | ||
'at$1 Test.<anonymous>' | ||
); | ||
}; |
@@ -11,3 +11,3 @@ var tape = require('../'); | ||
tap.test('deep equal failure', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var stream = test.createStream(); | ||
@@ -73,3 +73,3 @@ var parser = tapParser(); | ||
tap.test('deep equal failure, depth 6, with option', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var stream = test.createStream(); | ||
@@ -135,3 +135,3 @@ var parser = tapParser(); | ||
tap.test('deep equal failure, depth 6, without option', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var stream = test.createStream(); | ||
@@ -138,0 +138,0 @@ var parser = tapParser(); |
@@ -11,3 +11,3 @@ var falafel = require('falafel'); | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var tc = function (rows) { | ||
@@ -14,0 +14,0 @@ tt.same(stripFullStack(rows.toString('utf8')), [ |
@@ -10,3 +10,3 @@ var tape = require('../'); | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var tc = function (rows) { | ||
@@ -13,0 +13,0 @@ tt.same(stripFullStack(rows.toString('utf8')), [ |
@@ -6,3 +6,3 @@ var spawn = require('child_process').spawn; | ||
ps.stdout.pipe(process.stdout, { end : false }); | ||
ps.stdout.pipe(process.stdout, { end: false }); | ||
@@ -9,0 +9,0 @@ ps.stderr.on('data', function (buf) { |
@@ -11,3 +11,3 @@ var tape = require('../'); | ||
tap.test('deep equal failure', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var stream = test.createStream(); | ||
@@ -73,3 +73,3 @@ var parser = tapParser(); | ||
tap.test('not deep equal failure, depth 6, with option', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var stream = test.createStream(); | ||
@@ -135,3 +135,3 @@ var parser = tapParser(); | ||
tap.test('not deep equal failure, depth 6, without option', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var stream = test.createStream(); | ||
@@ -138,0 +138,0 @@ var parser = tapParser(); |
@@ -11,3 +11,3 @@ var tape = require('../'); | ||
tap.test('not equal failure', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var stream = test.createStream(); | ||
@@ -14,0 +14,0 @@ var parser = tapParser(); |
@@ -7,3 +7,3 @@ var tap = require("tap"); | ||
var noop = function () {}; | ||
var mockSink = {on:noop, removeListener:noop, emit:noop, end:noop}; | ||
var mockSink = {on: noop, removeListener: noop, emit: noop, end: noop}; | ||
tape.createStream().pipe(mockSink); | ||
@@ -10,0 +10,0 @@ |
@@ -5,3 +5,3 @@ var tape = require('../'); | ||
tap.test('only twice error', function (assert) { | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
@@ -8,0 +8,0 @@ test.only("first only", function (t) { |
@@ -11,3 +11,3 @@ var falafel = require('falafel'); | ||
var test = tape.createHarness({ exit : false }); | ||
var test = tape.createHarness({ exit: false }); | ||
var tc = function (rows) { | ||
@@ -14,0 +14,0 @@ tt.same(stripFullStack(rows.toString('utf8')), [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157646
106
4264
404
15
21
+ Addeddotignore@~0.1.2
+ Addeddotignore@0.1.2(transitive)
Updatedresolve@~1.14.2