Comparing version 3.1.0 to 3.2.0
@@ -14,3 +14,3 @@ /*! | ||
exports.version = '3.1.0'; | ||
exports.version = '3.2.0'; | ||
@@ -17,0 +17,0 @@ /*! |
@@ -1371,2 +1371,3 @@ /*! | ||
* @name respondTo | ||
* @alias respondsTo | ||
* @param {String} method | ||
@@ -1377,3 +1378,3 @@ * @param {String} message _optional_ | ||
Assertion.addMethod('respondTo', function (method, msg) { | ||
function respondTo (method, msg) { | ||
if (msg) flag(this, 'message', msg); | ||
@@ -1391,4 +1392,7 @@ var obj = flag(this, 'object') | ||
); | ||
}); | ||
} | ||
Assertion.addMethod('respondTo', respondTo); | ||
Assertion.addMethod('respondsTo', respondTo); | ||
/** | ||
@@ -1422,2 +1426,3 @@ * ### .itself | ||
* @name satisfy | ||
* @alias satisfies | ||
* @param {Function} matcher | ||
@@ -1428,3 +1433,3 @@ * @param {String} message _optional_ | ||
Assertion.addMethod('satisfy', function (matcher, msg) { | ||
function satisfy (matcher, msg) { | ||
if (msg) flag(this, 'message', msg); | ||
@@ -1440,3 +1445,6 @@ var obj = flag(this, 'object'); | ||
); | ||
}); | ||
} | ||
Assertion.addMethod('satisfy', satisfy); | ||
Assertion.addMethod('satisfies', satisfy); | ||
@@ -1721,3 +1729,3 @@ /** | ||
this.assert( | ||
Object.isSealed(obj) | ||
Object.isFrozen(obj) | ||
, 'expected #{this} to be frozen' | ||
@@ -1724,0 +1732,0 @@ , 'expected #{this} to not be frozen' |
@@ -67,10 +67,11 @@ /*! | ||
/** | ||
* ### .ok(object, [message]) | ||
* ### .isOk(object, [message]) | ||
* | ||
* Asserts that `object` is truthy. | ||
* | ||
* assert.ok('everything', 'everything is ok'); | ||
* assert.ok(false, 'this will fail'); | ||
* assert.isOk('everything', 'everything is ok'); | ||
* assert.isOk(false, 'this will fail'); | ||
* | ||
* @name ok | ||
* @name isOk | ||
* @alias ok | ||
* @param {Mixed} object to test | ||
@@ -81,3 +82,3 @@ * @param {String} message | ||
assert.ok = function (val, msg) { | ||
assert.isOk = function (val, msg) { | ||
new Assertion(val, msg).is.ok; | ||
@@ -87,10 +88,11 @@ }; | ||
/** | ||
* ### .notOk(object, [message]) | ||
* ### .isNotOk(object, [message]) | ||
* | ||
* Asserts that `object` is falsy. | ||
* | ||
* assert.notOk('everything', 'this will fail'); | ||
* assert.notOk(false, 'this will pass'); | ||
* assert.isNotOk('everything', 'this will fail'); | ||
* assert.isNotOk(false, 'this will pass'); | ||
* | ||
* @name notOk | ||
* @name isNotOk | ||
* @alias notOk | ||
* @param {Mixed} object to test | ||
@@ -101,3 +103,3 @@ * @param {String} message | ||
assert.notOk = function (val, msg) { | ||
assert.isNotOk = function (val, msg) { | ||
new Assertion(val, msg).is.not.ok; | ||
@@ -971,7 +973,7 @@ }; | ||
* | ||
* assert.throw(fn, 'function throws a reference error'); | ||
* assert.throw(fn, /function throws a reference error/); | ||
* assert.throw(fn, ReferenceError); | ||
* assert.throw(fn, ReferenceError, 'function throws a reference error'); | ||
* assert.throw(fn, ReferenceError, /function throws a reference error/); | ||
* assert.throws(fn, 'function throws a reference error'); | ||
* assert.throws(fn, /function throws a reference error/); | ||
* assert.throws(fn, ReferenceError); | ||
* assert.throws(fn, ReferenceError, 'function throws a reference error'); | ||
* assert.throws(fn, ReferenceError, /function throws a reference error/); | ||
* | ||
@@ -989,3 +991,3 @@ * @name throws | ||
assert.Throw = function (fn, errt, errs, msg) { | ||
assert.throws = function (fn, errt, errs, msg) { | ||
if ('string' === typeof errt || errt instanceof RegExp) { | ||
@@ -996,3 +998,3 @@ errs = errt; | ||
var assertErr = new Assertion(fn, msg).to.Throw(errt, errs); | ||
var assertErr = new Assertion(fn, msg).to.throw(errt, errs); | ||
return flag(assertErr, 'object'); | ||
@@ -1287,3 +1289,3 @@ }; | ||
* Asserts if value is not a false value, and throws if it is a true value. | ||
* This is added to allow for chai to be a drop-in replacement for Node's | ||
* This is added to allow for chai to be a drop-in replacement for Node's | ||
* assert class. | ||
@@ -1306,9 +1308,10 @@ * | ||
/** | ||
* ### .extensible(object) | ||
* ### .isExtensible(object) | ||
* | ||
* Asserts that `object` is extensible (can have new properties added to it). | ||
* | ||
* assert.extensible({}); | ||
* assert.isExtensible({}); | ||
* | ||
* @name extensible | ||
* @name isExtensible | ||
* @alias extensible | ||
* @param {Object} object | ||
@@ -1319,3 +1322,3 @@ * @param {String} message _optional_ | ||
assert.extensible = function (obj, msg) { | ||
assert.isExtensible = function (obj, msg) { | ||
new Assertion(obj, msg).to.be.extensible; | ||
@@ -1325,3 +1328,3 @@ }; | ||
/** | ||
* ### .notExtensible(object) | ||
* ### .isNotExtensible(object) | ||
* | ||
@@ -1334,7 +1337,8 @@ * Asserts that `object` is _not_ extensible. | ||
* | ||
* assert.notExtensible(nonExtensibleObject); | ||
* assert.notExtensible(sealedObject); | ||
* assert.notExtensible(frozenObject); | ||
* assert.isNotExtensible(nonExtensibleObject); | ||
* assert.isNotExtensible(sealedObject); | ||
* assert.isNotExtensible(frozenObject); | ||
* | ||
* @name notExtensible | ||
* @name isNotExtensible | ||
* @alias notExtensible | ||
* @param {Object} object | ||
@@ -1345,3 +1349,3 @@ * @param {String} message _optional_ | ||
assert.notExtensible = function (obj, msg) { | ||
assert.isNotExtensible = function (obj, msg) { | ||
new Assertion(obj, msg).to.not.be.extensible; | ||
@@ -1351,3 +1355,3 @@ }; | ||
/** | ||
* ### .sealed(object) | ||
* ### .isSealed(object) | ||
* | ||
@@ -1360,6 +1364,7 @@ * Asserts that `object` is sealed (cannot have new properties added to it | ||
* | ||
* assert.sealed(sealedObject); | ||
* assert.sealed(frozenObject); | ||
* assert.isSealed(sealedObject); | ||
* assert.isSealed(frozenObject); | ||
* | ||
* @name sealed | ||
* @name isSealed | ||
* @alias sealed | ||
* @param {Object} object | ||
@@ -1370,3 +1375,3 @@ * @param {String} message _optional_ | ||
assert.sealed = function (obj, msg) { | ||
assert.isSealed = function (obj, msg) { | ||
new Assertion(obj, msg).to.be.sealed; | ||
@@ -1376,9 +1381,10 @@ }; | ||
/** | ||
* ### .notSealed(object) | ||
* ### .isNotSealed(object) | ||
* | ||
* Asserts that `object` is _not_ sealed. | ||
* | ||
* assert.notSealed({}); | ||
* assert.isNotSealed({}); | ||
* | ||
* @name notSealed | ||
* @name isNotSealed | ||
* @alias notSealed | ||
* @param {Object} object | ||
@@ -1389,3 +1395,3 @@ * @param {String} message _optional_ | ||
assert.notSealed = function (obj, msg) { | ||
assert.isNotSealed = function (obj, msg) { | ||
new Assertion(obj, msg).to.not.be.sealed; | ||
@@ -1395,3 +1401,3 @@ }; | ||
/** | ||
* ### .frozen(object) | ||
* ### .isFrozen(object) | ||
* | ||
@@ -1404,3 +1410,4 @@ * Asserts that `object` is frozen (cannot have new properties added to it | ||
* | ||
* @name frozen | ||
* @name isFrozen | ||
* @alias frozen | ||
* @param {Object} object | ||
@@ -1411,3 +1418,3 @@ * @param {String} message _optional_ | ||
assert.frozen = function (obj, msg) { | ||
assert.isFrozen = function (obj, msg) { | ||
new Assertion(obj, msg).to.be.frozen; | ||
@@ -1417,9 +1424,10 @@ }; | ||
/** | ||
* ### .notFrozen(object) | ||
* ### .isNotFrozen(object) | ||
* | ||
* Asserts that `object` is _not_ frozen. | ||
* | ||
* assert.notFrozen({}); | ||
* assert.isNotFrozen({}); | ||
* | ||
* @name notSealed | ||
* @name isNotFrozen | ||
* @alias notFrozen | ||
* @param {Object} object | ||
@@ -1430,3 +1438,3 @@ * @param {String} message _optional_ | ||
assert.notFrozen = function (obj, msg) { | ||
assert.isNotFrozen = function (obj, msg) { | ||
new Assertion(obj, msg).to.not.be.frozen; | ||
@@ -1443,4 +1451,12 @@ }; | ||
}) | ||
('Throw', 'throw') | ||
('Throw', 'throws'); | ||
('isOk', 'ok') | ||
('isNotOk', 'notOk') | ||
('throws', 'throw') | ||
('throws', 'Throw') | ||
('isExtensible', 'extensible') | ||
('isNotExtensible', 'notExtensible') | ||
('isSealed', 'sealed') | ||
('isNotSealed', 'notSealed') | ||
('isFrozen', 'frozen') | ||
('isNotFrozen', 'notFrozen'); | ||
}; |
@@ -20,3 +20,3 @@ /*! | ||
module.exports = function getProperties(object) { | ||
var result = Object.getOwnPropertyNames(subject); | ||
var result = Object.getOwnPropertyNames(object); | ||
@@ -29,3 +29,3 @@ function addProperty(property) { | ||
var proto = Object.getPrototypeOf(subject); | ||
var proto = Object.getPrototypeOf(object); | ||
while (proto !== null) { | ||
@@ -32,0 +32,0 @@ Object.getOwnPropertyNames(proto).forEach(addProperty); |
@@ -20,3 +20,3 @@ { | ||
], | ||
"version": "3.1.0", | ||
"version": "3.2.0", | ||
"repository": { | ||
@@ -23,0 +23,0 @@ "type": "git", |
@@ -33,2 +33,13 @@ [![Chai Documentation](http://chaijs.com/public/img/chai-logo.png)](http://chaijs.com) | ||
### Contributing | ||
Thank you very much for considering to contribute! | ||
Here are a few issues other contributors frequently ran into when opening pull requests: | ||
- Please do not commit changes to the `chai.js` build. We do it once per release. | ||
- Before pushing your commits, please make sure you [rebase](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md#pull-requests) them. | ||
We also strongly encourage you to read our detailed [contribution guidelines](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md). | ||
### Contributors | ||
@@ -35,0 +46,0 @@ |
Sorry, the diff of this file is too big to display
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
359526
9484
82