Comparing version 2.2.0 to 2.3.0
{ | ||
"name": "chai", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -0,1 +1,15 @@ | ||
2.3.0 / 2015-04-26 | ||
================== | ||
* Merge pull request #423 from ehntoo/patch-1 | ||
* Merge pull request #422 from ljharb/fix_descriptor_tests | ||
* Fix a small bug in the .null assertion docs | ||
* Use a regex to account for property ordering issues across engines. | ||
* Add `make test-firefox` | ||
* Merge pull request #417 from astorije/astorije/minimalist-typo | ||
* Remove trailing whitespaces | ||
* Fix super minor typo in an example | ||
* Merge pull request #408 from ljharb/enumerableProperty | ||
* Add `ownPropertyDescriptor` assertion. | ||
2.2.0 / 2015-03-26 | ||
@@ -2,0 +16,0 @@ ================== |
@@ -14,3 +14,3 @@ /*! | ||
exports.version = '2.2.0'; | ||
exports.version = '2.3.0'; | ||
@@ -17,0 +17,0 @@ /*! |
@@ -96,3 +96,3 @@ /*! | ||
* Sets the `any` flag, (opposite of the `all` flag) | ||
* later used in the `keys` assertion. | ||
* later used in the `keys` assertion. | ||
* | ||
@@ -114,3 +114,3 @@ * expect(foo).to.have.any.keys('bar', 'baz'); | ||
* | ||
* Sets the `all` flag (opposite of the `any` flag) | ||
* Sets the `all` flag (opposite of the `any` flag) | ||
* later used by the `keys` assertion. | ||
@@ -296,3 +296,3 @@ * | ||
* expect(null).to.be.null; | ||
* expect(undefined).not.to.be.null; | ||
* expect(undefined).to.not.be.null; | ||
* | ||
@@ -773,3 +773,3 @@ * @name null | ||
* }; | ||
* | ||
* | ||
* expect(deepObj).to.have.deep.property('green.tea', 'matcha'); | ||
@@ -896,2 +896,51 @@ * expect(deepObj).to.have.deep.property('teas[1]', 'matcha'); | ||
/** | ||
* ### .ownPropertyDescriptor(name[, descriptor[, message]]) | ||
* | ||
* Asserts that the target has an own property descriptor `name`, that optionally matches `descriptor`. | ||
* | ||
* expect('test').to.have.ownPropertyDescriptor('length'); | ||
* expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); | ||
* expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); | ||
* expect('test').ownPropertyDescriptor('length').to.have.property('enumerable', false); | ||
* expect('test').ownPropertyDescriptor('length').to.have.keys('value'); | ||
* | ||
* @name ownPropertyDescriptor | ||
* @alias haveOwnPropertyDescriptor | ||
* @param {String} name | ||
* @param {Object} descriptor _optional_ | ||
* @param {String} message _optional_ | ||
* @api public | ||
*/ | ||
function assertOwnPropertyDescriptor (name, descriptor, msg) { | ||
if (typeof descriptor === 'string') { | ||
msg = descriptor; | ||
descriptor = null; | ||
} | ||
if (msg) flag(this, 'message', msg); | ||
var obj = flag(this, 'object'); | ||
var actualDescriptor = Object.getOwnPropertyDescriptor(Object(obj), name); | ||
if (actualDescriptor && descriptor) { | ||
this.assert( | ||
_.eql(descriptor, actualDescriptor) | ||
, 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to match ' + _.inspect(descriptor) + ', got ' + _.inspect(actualDescriptor) | ||
, 'expected the own property descriptor for ' + _.inspect(name) + ' on #{this} to not match ' + _.inspect(descriptor) | ||
, descriptor | ||
, actualDescriptor | ||
, true | ||
); | ||
} else { | ||
this.assert( | ||
actualDescriptor | ||
, 'expected #{this} to have an own property descriptor for ' + _.inspect(name) | ||
, 'expected #{this} to not have an own property descriptor for ' + _.inspect(name) | ||
); | ||
} | ||
flag(this, 'object', actualDescriptor); | ||
} | ||
Assertion.addMethod('ownPropertyDescriptor', assertOwnPropertyDescriptor); | ||
Assertion.addMethod('haveOwnPropertyDescriptor', assertOwnPropertyDescriptor); | ||
/** | ||
* ### .length(value) | ||
@@ -997,19 +1046,19 @@ * | ||
* Asserts that the target contains any or all of the passed-in keys. | ||
* Use in combination with `any`, `all`, `contains`, or `have` will affect | ||
* Use in combination with `any`, `all`, `contains`, or `have` will affect | ||
* what will pass. | ||
* | ||
* When used in conjunction with `any`, at least one key that is passed | ||
* in must exist in the target object. This is regardless whether or not | ||
* | ||
* When used in conjunction with `any`, at least one key that is passed | ||
* in must exist in the target object. This is regardless whether or not | ||
* the `have` or `contain` qualifiers are used. Note, either `any` or `all` | ||
* should be used in the assertion. If neither are used, the assertion is | ||
* defaulted to `all`. | ||
* | ||
* When both `all` and `contain` are used, the target object must have at | ||
* | ||
* When both `all` and `contain` are used, the target object must have at | ||
* least all of the passed-in keys but may have more keys not listed. | ||
* | ||
* | ||
* When both `all` and `have` are used, the target object must both contain | ||
* all of the passed-in keys AND the number of keys in the target object must | ||
* match the number of keys passed in (in other words, a target object must | ||
* match the number of keys passed in (in other words, a target object must | ||
* have all and only all of the passed-in keys). | ||
* | ||
* | ||
* expect({ foo: 1, bar: 2 }).to.have.any.keys('foo', 'baz'); | ||
@@ -1021,3 +1070,3 @@ * expect({ foo: 1, bar: 2 }).to.have.any.keys('foo'); | ||
* expect({ foo: 1, bar: 2 }).to.have.all.keys(['bar', 'foo']); | ||
* expect({ foo: 1, bar: 2 }).to.have.all.keys({'bar': 6, 'foo', 7}); | ||
* expect({ foo: 1, bar: 2 }).to.have.all.keys({'bar': 6, 'foo': 7}); | ||
* expect({ foo: 1, bar: 2, baz: 3 }).to.contain.all.keys(['bar', 'foo']); | ||
@@ -1024,0 +1073,0 @@ * expect({ foo: 1, bar: 2, baz: 3 }).to.contain.all.keys([{'bar': 6}}]); |
@@ -20,3 +20,3 @@ { | ||
], | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"repository": { | ||
@@ -46,2 +46,3 @@ "type": "git", | ||
"karma-phantomjs-launcher": "0.1.1", | ||
"karma-firefox-launcher": "^0.1.4", | ||
"mocha": "1.21.x", | ||
@@ -48,0 +49,0 @@ "istanbul": "0.2.x" |
@@ -28,11 +28,11 @@ [![Chai Documentation](http://chaijs.com/public/img/chai-logo.png)](http://chaijs.com) | ||
project : chai | ||
repo age : 3 years, 3 months | ||
active : 232 days | ||
commits : 879 | ||
repo age : 3 years, 5 months | ||
active : 244 days | ||
commits : 900 | ||
files : 59 | ||
authors : | ||
555 Jake Luer 63.1% | ||
79 Veselin Todorov 9.0% | ||
43 Domenic Denicola 4.9% | ||
41 Keith Cirkel 4.7% | ||
555 Jake Luer 61.7% | ||
79 Veselin Todorov 8.8% | ||
52 Keith Cirkel 5.8% | ||
43 Domenic Denicola 4.8% | ||
14 Joshua Perry 1.6% | ||
@@ -42,46 +42,34 @@ 8 Chris Polis 0.9% | ||
6 Ian Zamojc 0.7% | ||
5 George Kats 0.6% | ||
5 leider 0.6% | ||
5 George Kats 0.6% | ||
5 Scott Nonnenberg 0.6% | ||
5 Juliusz Gonera 0.6% | ||
5 Jo Liss 0.6% | ||
5 Juliusz Gonera 0.6% | ||
4 Veselin 0.5% | ||
4 Nick Heiner 0.5% | ||
4 David da Silva 0.5% | ||
4 Chris Jones 0.5% | ||
4 josher19 0.5% | ||
4 John Firebaugh 0.5% | ||
4 Max Edmands 0.5% | ||
4 charlierudolph 0.5% | ||
4 Jérémie Astori 0.4% | ||
4 John Firebaugh 0.4% | ||
4 charlierudolph 0.4% | ||
4 Veselin 0.4% | ||
4 Chris Jones 0.4% | ||
4 Nick Heiner 0.4% | ||
4 Max Edmands 0.4% | ||
4 David da Silva 0.4% | ||
4 Kaito Udagawa 0.4% | ||
4 josher19 0.4% | ||
3 Jordan Harband 0.3% | ||
3 Ryunosuke SATO 0.3% | ||
3 Jake Rosoman 0.3% | ||
3 Duncan Beevers 0.3% | ||
3 Jason Karns 0.3% | ||
3 Jeff Barczewski 0.3% | ||
3 Andrei Neculau 0.3% | ||
3 Duncan Beevers 0.3% | ||
3 Jake Rosoman 0.3% | ||
2 Teddy Cross 0.2% | ||
2 eldritch fossicker 0.2% | ||
2 Bartvds 0.2% | ||
2 Edwin Shao 0.2% | ||
2 Gregg Lind 0.2% | ||
2 Jakub Nešetřil 0.2% | ||
2 Roman Masek 0.2% | ||
2 Jérémie Astori 0.2% | ||
2 Jakub Nešetřil 0.2% | ||
2 eldritch fossicker 0.2% | ||
1 Adam Hull 0.1% | ||
1 toastynerd 0.1% | ||
1 Anand Patil 0.1% | ||
1 Benjamin Horsleben 0.1% | ||
1 Brandon Payton 0.1% | ||
1 Chasen Le Hara 0.1% | ||
1 Chris Connelly 0.1% | ||
1 Chris Thompson 0.1% | ||
1 Christopher Hiller 0.1% | ||
1 Chun-Yi 0.1% | ||
1 DD 0.1% | ||
1 Danilo Vaz 0.1% | ||
2 Teddy Cross 0.2% | ||
1 Jesse McCarthy 0.1% | ||
1 Doug Neiner 0.1% | ||
1 Dido Arellano 0.1% | ||
1 Doug Neiner 0.1% | ||
1 Jeff Welch 0.1% | ||
1 Jesse McCarthy 0.1% | ||
1 Julien Wajsberg 0.1% | ||
1 Kilian Ciuffolo 0.1% | ||
@@ -91,7 +79,17 @@ 1 Luís Cardoso 0.1% | ||
1 Mathias Schreck 0.1% | ||
1 Danilo Vaz 0.1% | ||
1 Michael Lange 0.1% | ||
1 Mitchell Johnson 0.1% | ||
1 DD 0.1% | ||
1 Niklas Närhinen 0.1% | ||
1 Paul Miller 0.1% | ||
1 Refael Ackermann 0.1% | ||
1 shinnn 0.1% | ||
1 Chun-Yi 0.1% | ||
1 Christopher Hiller 0.1% | ||
1 Sasha Koss 0.1% | ||
1 Chris Thompson 0.1% | ||
1 toastynerd 0.1% | ||
1 Chris Connelly 0.1% | ||
1 Chasen Le Hara 0.1% | ||
1 Victor Costan 0.1% | ||
@@ -101,8 +99,13 @@ 1 Vinay Pulim 0.1% | ||
1 Vlad GURDIGA 0.1% | ||
1 Brandon Payton 0.1% | ||
1 Adam Hull 0.1% | ||
1 ericdouglas 0.1% | ||
1 Benjamin Horsleben 0.1% | ||
1 laconbass 0.1% | ||
1 Anand Patil 0.1% | ||
1 mohayonao 0.1% | ||
1 piecioshka 0.1% | ||
1 root 0.1% | ||
1 shinnn 0.1% | ||
1 Julien Wajsberg 0.1% | ||
1 Jeff Welch 0.1% | ||
@@ -109,0 +112,0 @@ ## License |
# Release Notes | ||
## 2.3.0 / 2015-04-26 | ||
Added `ownPropertyDescriptor` assertion: | ||
```js | ||
expect('test').to.have.ownPropertyDescriptor('length'); | ||
expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 }); | ||
expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 }); | ||
expect('test').ownPropertyDescriptor('length').to.have.property('enumerable', false); | ||
expect('test').ownPropertyDescriptor('length').to.have.keys('value'); | ||
``` | ||
### Community Contributions | ||
#### Code Features & Fixes | ||
* [#408](https://github.com/chaijs/chai/pull/408) Add `ownPropertyDescriptor` | ||
assertion. | ||
By [@ljharb](https://github.com/ljharb) | ||
* [#422](https://github.com/chaijs/chai/pull/422) Improve ownPropertyDescriptor | ||
tests. | ||
By [@ljharb](https://github.com/ljharb) | ||
#### Documentation fixes | ||
* [#417](https://github.com/chaijs/chai/pull/417) Fix documentation typo | ||
By [@astorije](https://github.com/astorije) | ||
* [#423](https://github.com/chaijs/chai/pull/423) Fix inconsistency in docs. | ||
By [@ehntoo](https://github.com/ehntoo) | ||
## 2.2.0 / 2015-03-26 | ||
@@ -4,0 +35,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
348594
9050
131
8
1