Comparing version 5.0.0-next.1 to 5.0.0-next.2
@@ -17,2 +17,3 @@ "use strict"; | ||
var isProto = bind.call(Function.call, Object.prototype.isPrototypeOf); | ||
var $test = bind.call(Function.call, RegExp.prototype.test); | ||
@@ -625,2 +626,37 @@ module.exports = Test; | ||
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) { | ||
@@ -627,0 +663,0 @@ var args = getTestArgs.apply(null, arguments); |
{ | ||
"name": "tape", | ||
"version": "5.0.0-next.1", | ||
"version": "5.0.0-next.2", | ||
"description": "tap-producing test harness for node and browsers", | ||
@@ -25,2 +25,3 @@ "main": "index.js", | ||
"defined": "^1.0.0", | ||
"dotignore": "^0.1.2", | ||
"for-each": "^0.3.3", | ||
@@ -27,0 +28,0 @@ "function-bind": "^1.1.1", |
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
183373
119
5037
402
16
24
+ Addeddotignore@^0.1.2
+ Addeddotignore@0.1.2(transitive)