Skip to content

Commit

Permalink
Release 2.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
keithamus committed Apr 26, 2015
1 parent b8807a2 commit 2abd737
Show file tree
Hide file tree
Showing 9 changed files with 160 additions and 61 deletions.
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
sudo: false
language: node_js
node_js:
- 0.1
Expand All @@ -14,9 +15,10 @@ env:

deploy:
provider: npm
email: jake@alogicalparadox.com
email:
secure: "M9J56tqJwOxn6D3PSh8BNGac/8XjTCRGCFexN5QFl7Ha9AKnyQTy1ZAaJonMGoClBhh37Dy/89wVWmqg4NPckrD5Ej7NvwhTjVfEHusllaCROqVu5m7ijS3WKlIxM/xtBzU7SqRY41JxloP+CLKxRiKRWQJDvgwUZW7OHdmAkAY="
api_key:
secure: AgNQTECM/3Gh0q77gkrMx0jASgRh/dysPdUf7Zdsm1k9Gt+i4H99k2L8lVWqpLF1+e6lhWg9w4C08Xgz6tuOTPZZr6UzeRDl+ZjniTYK3E/tpcUbqAQxxgD4b3iA6BLbF0YKGofnWrMtXBBWI8X0jekxncu7sWdBuieyhg33fik=
secure: "bH1U+PiDXBwvI5M2NQMhxYmTc2Ugl9Nfw3AEttsJaBreAjCPkue6Iusr1W9QeHMOytKDDX7M1anLqrn7XpokfNkG7Jqeh1mlkdK+qlTrB1lOsiZ7hbdYH/dOUYITzm7NRTjzg4i9oIuIPOTGYvsvipbatDdCKSK+8iKxX5EBtiQ="
on:
tags: true
repo: chaijs/chai
Expand Down
14 changes: 14 additions & 0 deletions History.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
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
==================

Expand Down
83 changes: 43 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,82 +25,85 @@ Chai offers a robust Plugin architecture for extending Chai's assertions and int
### Contributors

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%
8 Chris Polis 0.9%
6 Ruben Verborgh 0.7%
6 Ian Zamojc 0.7%
5 leider 0.6%
5 George Kats 0.6%
5 leider 0.6%
5 Scott Nonnenberg 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%
5 Jo Liss 0.6%
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 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%
1 Dido Arellano 0.1%
1 Doug Neiner 0.1%
1 Jeff Welch 0.1%
2 Roman Masek 0.2%
2 Teddy Cross 0.2%
1 Jesse McCarthy 0.1%
1 Julien Wajsberg 0.1%
1 Doug Neiner 0.1%
1 Dido Arellano 0.1%
1 Kilian Ciuffolo 0.1%
1 Luís Cardoso 0.1%
1 Martin Middel 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%
1 Vinay Pulim 0.1%
1 Virginie BARDALES 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%

## License

Expand Down
31 changes: 31 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,36 @@
# 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

Deep property strings can now be escaped using `\\` - for example:
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "chai",
"version": "2.2.0",
"version": "2.3.0",
"description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.",
"license": "MIT",
"keywords": [
Expand Down
79 changes: 64 additions & 15 deletions chai.js
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ var used = []
* Chai version
*/

exports.version = '2.2.0';
exports.version = '2.3.0';

/*!
* Assertion Error
Expand Down Expand Up @@ -1051,7 +1051,7 @@ module.exports = function (chai, _) {
* ### .any
*
* Sets the `any` flag, (opposite of the `all` flag)
* later used in the `keys` assertion.
* later used in the `keys` assertion.
*
* expect(foo).to.have.any.keys('bar', 'baz');
*
Expand All @@ -1068,7 +1068,7 @@ module.exports = function (chai, _) {
/**
* ### .all
*
* Sets the `all` flag (opposite of the `any` flag)
* Sets the `all` flag (opposite of the `any` flag)
* later used by the `keys` assertion.
*
* expect(foo).to.have.all.keys('bar', 'baz');
Expand Down Expand Up @@ -1249,7 +1249,7 @@ module.exports = function (chai, _) {
* Asserts that the target is `null`.
*
* expect(null).to.be.null;
* expect(undefined).not.to.be.null;
* expect(undefined).to.not.be.null;
*
* @name null
* @api public
Expand Down Expand Up @@ -1725,7 +1725,7 @@ module.exports = function (chai, _) {
* green: { tea: 'matcha' }
* , teas: [ 'chai', 'matcha', { tea: 'konacha' } ]
* };
*
*
* expect(deepObj).to.have.deep.property('green.tea', 'matcha');
* expect(deepObj).to.have.deep.property('teas[1]', 'matcha');
* expect(deepObj).to.have.deep.property('teas[2].tea', 'konacha');
Expand Down Expand Up @@ -1846,6 +1846,55 @@ module.exports = function (chai, _) {
Assertion.addMethod('ownProperty', assertOwnProperty);
Assertion.addMethod('haveOwnProperty', assertOwnProperty);

/**
* ### .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)
*
Expand Down Expand Up @@ -1947,30 +1996,30 @@ module.exports = function (chai, _) {
* ### .keys(key1, [key2], [...])
*
* 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');
* expect({ foo: 1, bar: 2 }).to.have.any.keys('foo');
* expect({ foo: 1, bar: 2 }).to.contain.any.keys('bar', 'baz');
* expect({ foo: 1, bar: 2 }).to.contain.any.keys(['foo']);
* expect({ foo: 1, bar: 2 }).to.contain.any.keys({'foo': 6});
* 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']);
* expect({ foo: 1, bar: 2, baz: 3 }).to.contain.all.keys([{'bar': 6}}]);
*
Expand Down
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "chai"
, "repo": "chaijs/chai"
, "version": "2.2.0"
, "version": "2.3.0"
, "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."
, "license": "MIT"
, "keywords": [
Expand Down
2 changes: 1 addition & 1 deletion lib/chai.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var used = []
* Chai version
*/

exports.version = '2.2.0';
exports.version = '2.3.0';

/*!
* Assertion Error
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"Veselin Todorov <hi@vesln.com>",
"John Firebaugh <john.firebaugh@gmail.com>"
],
"version": "2.2.0",
"version": "2.3.0",
"repository": {
"type": "git",
"url": "https://github.com/chaijs/chai"
Expand Down

0 comments on commit 2abd737

Please sign in to comment.