unexpected
Advanced tools
Comparing version 1.0.4 to 1.0.5
@@ -137,2 +137,6 @@ // Copyright (c) 2013 Sune Simonsen <sune@we-knowhow.dk> | ||
Unexpected.prototype.toString = function () { | ||
return getKeys(this.assertions).sort().join('\n'); | ||
}; | ||
Unexpected.prototype.inspect = inspect; | ||
@@ -147,2 +151,3 @@ Unexpected.prototype.eql = eql; | ||
expect.clone = bind(unexpected.clone, unexpected); | ||
expect.toString = bind(unexpected.toString, unexpected); | ||
expect.assertions = unexpected.assertions; | ||
@@ -149,0 +154,0 @@ return expect; |
{ | ||
"name": "unexpected", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"author": "Sune Sloth Simonsen <sune@we-knowhow.dk>", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -94,7 +94,13 @@ # Unexpected | ||
expect(1, 'to be', 1); | ||
expect(undefined, 'to be undefined'); | ||
expect(null, 'to be null'); | ||
expect(1, 'not to be', true); | ||
expect('1', 'not to be', 1); | ||
expect(null, 'not to be', undefined); | ||
expect(null, 'to be null'); | ||
expect(0, 'not to be null'); | ||
expect(undefined, 'not to be null'); | ||
expect(true, 'to be true'); | ||
expect(false, 'not to be true'); | ||
expect(false, 'to be false'); | ||
expect(true, 'not to be false'); | ||
expect(undefined, 'to be undefined'); | ||
``` | ||
@@ -293,4 +299,10 @@ | ||
## Using with a test framework | ||
## Print all registered assertions to the console | ||
```js | ||
console.log(expect.toString()); | ||
``` | ||
## Using Unexpected with a test framework | ||
For example, if you create a test suite with | ||
@@ -297,0 +309,0 @@ [mocha](http://github.com/visionmedia/mocha). |
@@ -60,3 +60,5 @@ /*global describe, it, expect*/ | ||
expect(true, 'to be true'); | ||
expect(false, 'not to be true'); | ||
expect(false, 'to be false'); | ||
expect(true, 'not to be false'); | ||
expect(undefined, 'to be undefined'); | ||
@@ -63,0 +65,0 @@ if (typeof Buffer !== 'undefined') { |
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
206552
6401
377