diff --git a/History.md b/History.md index f611577..d755fce 100644 --- a/History.md +++ b/History.md @@ -1,3 +1,18 @@ +2.1.1 / 2015-03-04 +================== + + * Merge pull request #385 from eldritch-fossicker/master + * updates to reflect code style preference from @keithamus + * fix indexing into array with deep propery + * Merge pull request #382 from astorije/patch-2 + * Merge pull request #383 from gurdiga/config-doc-wording-improvement + * config.truncateThreshold docs: simpler wording + * Add missing docstring for showDiff argument of assert + * Merge pull request #381 from astorije/patch-1 + * Add a minor precision that empty asserts on strings too. + * Merge pull request #379 from dcneiner/should-primitive-fix + * Primitives now use valueOf in shouldGetter + 2.1.0 / 2015-02-23 ================== diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 3eadb4c..d9d6b78 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -1,5 +1,29 @@ # Release Notes +## 2.1.1 / 2015-03-04 + +Two minor bugfixes. No new features. + +### Community Contributions + +#### Code Features & Fixes + + * [#385](https://github.com/chaijs/chai/pull/385) Fix a bug (also described in + [#387](https://github.com/chaijs/chai/pull/385)) where `deep.property` would not work with single + key names. By [@eldritch-fossicker](https://github.com/eldritch-fossicker) + * [#379](https://github.com/chaijs/chai/pull/379) Fix bug where tools which overwrite + primitive prototypes, such as Babel or core-js would fail. + By [@dcneiner](https://github.com/dcneiner) + +#### Documentation fixes + + * [#382](https://github.com/chaijs/chai/pull/382) Add doc for showDiff argument in assert. + By [@astorije](https://github.com/astorije) + * [#383](https://github.com/chaijs/chai/pull/383) Improve wording for truncateTreshold docs + By [@gurdiga](https://github.com/gurdiga) + * [#381](https://github.com/chaijs/chai/pull/381) Improve wording for assert.empty docs + By [@astorije](https://github.com/astorije) + ## 2.1.0 / 2015-02-23 Small release; fixes an issue where the Chai lib was incorrectly reporting the diff --git a/bower.json b/bower.json index 51e32da..cbef666 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "chai", - "version": "2.1.0", + "version": "2.1.1", "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.", "license": "MIT", "keywords": [ diff --git a/chai.js b/chai.js index 55f7a5a..9218d19 100644 --- a/chai.js +++ b/chai.js @@ -678,7 +678,7 @@ var used = [] * Chai version */ -exports.version = '2.1.0'; +exports.version = '2.1.1'; /*! * Assertion Error @@ -852,10 +852,11 @@ module.exports = function (_chai, util) { * * @name assert * @param {Philosophical} expression to be tested - * @param {String or Function} message or function that returns message to display if fails + * @param {String or Function} message or function that returns message to display if expression fails * @param {String or Function} negatedMessage or function that returns negatedMessage to display if negated expression fails * @param {Mixed} expected value (remember to check for negation) * @param {Mixed} actual (optional) will default to `this.obj` + * @param {Boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails * @api private */ @@ -1305,7 +1306,7 @@ module.exports = function (chai, _) { /** * ### .empty * - * Asserts that the target's length is `0`. For arrays, it checks + * Asserts that the target's length is `0`. For arrays and strings, it checks * the `length` property. For objects, it gets the count of * enumerable keys. * @@ -3783,10 +3784,8 @@ module.exports = function (chai, util) { function loadShould () { // explicitly define this method as function as to have it's name to include as `ssfi` function shouldGetter() { - if (this instanceof String || this instanceof Number) { - return new Assertion(this.constructor(this), null, shouldGetter); - } else if (this instanceof Boolean) { - return new Assertion(this == true, null, shouldGetter); + if (this instanceof String || this instanceof Number || this instanceof Boolean ) { + return new Assertion(this.valueOf(), null, shouldGetter); } return new Assertion(this, null, shouldGetter); } @@ -4326,7 +4325,7 @@ module.exports = function getPathInfo(path, obj) { last = parsed[parsed.length - 1]; var info = { - parent: _getPathValue(parsed, obj, parsed.length - 1), + parent: parsed.length > 1 ? _getPathValue(parsed, obj, parsed.length - 1) : obj, name: last.p || last.i, value: _getPathValue(parsed, obj), }; diff --git a/component.json b/component.json index 345332a..fe952a2 100644 --- a/component.json +++ b/component.json @@ -1,7 +1,7 @@ { "name": "chai" , "repo": "chaijs/chai" - , "version": "2.1.0" + , "version": "2.1.1" , "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic." , "license": "MIT" , "keywords": [ diff --git a/lib/chai.js b/lib/chai.js index cbf28b1..e93f6ae 100644 --- a/lib/chai.js +++ b/lib/chai.js @@ -11,7 +11,7 @@ var used = [] * Chai version */ -exports.version = '2.1.0'; +exports.version = '2.1.1'; /*! * Assertion Error diff --git a/package.json b/package.json index b0a8cf0..2edc115 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "Veselin Todorov ", "John Firebaugh " ], - "version": "2.1.0", + "version": "2.1.1", "repository": { "type": "git", "url": "https://github.com/chaijs/chai"