mirror of
https://github.com/chaijs/chai
synced 2024-11-15 00:07:11 +00:00
commit
d7cafca023
7 changed files with 50 additions and 12 deletions
15
History.md
15
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
|
||||
==================
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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": [
|
||||
|
|
15
chai.js
15
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),
|
||||
};
|
||||
|
|
|
@ -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": [
|
||||
|
|
|
@ -11,7 +11,7 @@ var used = []
|
|||
* Chai version
|
||||
*/
|
||||
|
||||
exports.version = '2.1.0';
|
||||
exports.version = '2.1.1';
|
||||
|
||||
/*!
|
||||
* Assertion Error
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
"Veselin Todorov <hi@vesln.com>",
|
||||
"John Firebaugh <john.firebaugh@gmail.com>"
|
||||
],
|
||||
"version": "2.1.0",
|
||||
"version": "2.1.1",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/chaijs/chai"
|
||||
|
|
Loading…
Reference in a new issue