unexpected
Advanced tools
Comparing version 0.0.6 to 0.0.7
@@ -264,2 +264,8 @@ // Copyright (c) 2013 Sune Simonsen <sune@we-knowhow.dk> | ||
// Alias for common 'to [not] be (a|an)' assertions | ||
expect.addAssertion('to [not] be (a|an) (boolean|number|string|function|object|array)', function () { | ||
var matches = /(.*) (\w+)/.exec(this.testDescription); | ||
expect(this.obj, matches[1], matches[2]); | ||
}); | ||
expect.addAssertion('to [not] match', function (regexp) { | ||
@@ -266,0 +272,0 @@ this.assert(regexp.exec(this.obj)); |
{ | ||
"name": "unexpected", | ||
"version": "0.0.6", | ||
"version": "0.0.7", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
# Unexpected | ||
**Warning: this is not totally ready for prime time yet** | ||
Minimalistic BDD assertion toolkit based on | ||
@@ -73,2 +71,6 @@ [expect.js](https://github.com/LearnBoost/expect.js) | ||
### to be ok | ||
asserts that the value is _truthy_ | ||
**ok** / **truthy** / **falsy**: asserts that the value is _truthy_ or not | ||
@@ -75,0 +77,0 @@ |
@@ -63,7 +63,14 @@ /*global describe, it, expect*/ | ||
expect(5, 'to be a', 'number'); | ||
expect(5, 'to be a number'); | ||
expect([], 'to be an', 'array'); | ||
expect([], 'to be an array'); | ||
expect([], 'to be an', 'object'); | ||
expect([], 'to be an object'); | ||
expect([], 'to be an', Array); | ||
expect(null, 'to not be an', 'object'); | ||
expect(null, 'to not be an object'); | ||
expect(true, 'to be a', 'boolean'); | ||
expect(true, 'to be a boolean'); | ||
expect("".substring, 'to be a', 'function'); | ||
expect("".substring, 'to be a function'); | ||
}); | ||
@@ -70,0 +77,0 @@ |
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
187617
6036
330