Skip to content

Commit

Permalink
Revert "Fix #1090"
Browse files Browse the repository at this point in the history
This reverts commit 12a70f4.
  • Loading branch information
sukrosono committed Nov 23, 2017
1 parent 216a3f3 commit d3d5b24
Showing 1 changed file with 54 additions and 52 deletions.
106 changes: 54 additions & 52 deletions lib/chai/interface/assert.js
Expand Up @@ -1012,49 +1012,49 @@ module.exports = function (chai, util) {

/**
* ### .nestedInclude(haystack, needle, [message])
*
* Asserts that 'haystack' includes 'needle'.
* Can be used to assert the inclusion of a subset of properties in an
*
* Asserts that 'haystack' includes 'needle'.
* Can be used to assert the inclusion of a subset of properties in an
* object.
* Enables the use of dot- and bracket-notation for referencing nested
* Enables the use of dot- and bracket-notation for referencing nested
* properties.
* '[]' and '.' in property names can be escaped using double backslashes.
*
*
* assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
* assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
*
*
* @name nestedInclude
* @param {Object} haystack
* @param {Object} needle
* @param {String} message
* @namespace Assert
* @api public
*/
* @api public
*/

assert.nestedInclude = function (exp, inc, msg) {
new Assertion(exp, msg, assert.nestedInclude, true).nested.include(inc);
};

/**
* ### .notNestedInclude(haystack, needle, [message])
*
* Asserts that 'haystack' does not include 'needle'.
* Can be used to assert the absence of a subset of properties in an
*
* Asserts that 'haystack' does not include 'needle'.
* Can be used to assert the absence of a subset of properties in an
* object.
* Enables the use of dot- and bracket-notation for referencing nested
* properties.
* Enables the use of dot- and bracket-notation for referencing nested
* properties.
* '[]' and '.' in property names can be escaped using double backslashes.
*
*
* assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'});
* assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
*
*
* @name notNestedInclude
* @param {Object} haystack
* @param {Object} needle
* @param {String} message
* @namespace Assert
* @api public
*/
* @api public
*/

assert.notNestedInclude = function (exp, inc, msg) {
new Assertion(exp, msg, assert.notNestedInclude, true)
Expand All @@ -1063,23 +1063,23 @@ module.exports = function (chai, util) {

/**
* ### .deepNestedInclude(haystack, needle, [message])
*
*
* Asserts that 'haystack' includes 'needle'.
* Can be used to assert the inclusion of a subset of properties in an
* Can be used to assert the inclusion of a subset of properties in an
* object while checking for deep equality.
* Enables the use of dot- and bracket-notation for referencing nested
* Enables the use of dot- and bracket-notation for referencing nested
* properties.
* '[]' and '.' in property names can be escaped using double backslashes.
*
*
* assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}});
* assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
*
*
* @name deepNestedInclude
* @param {Object} haystack
* @param {Object} needle
* @param {String} message
* @namespace Assert
* @api public
* @api public
*/

assert.deepNestedInclude = function(exp, inc, msg) {
Expand All @@ -1089,23 +1089,23 @@ module.exports = function (chai, util) {

/**
* ### .notDeepNestedInclude(haystack, needle, [message])
*
*
* Asserts that 'haystack' does not include 'needle'.
* Can be used to assert the absence of a subset of properties in an
* Can be used to assert the absence of a subset of properties in an
* object while checking for deep equality.
* Enables the use of dot- and bracket-notation for referencing nested
* Enables the use of dot- and bracket-notation for referencing nested
* properties.
* '[]' and '.' in property names can be escaped using double backslashes.
*
*
* assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
* assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
*
*
* @name notDeepNestedInclude
* @param {Object} haystack
* @param {Object} needle
* @param {String} message
* @namespace Assert
* @api public
* @api public
*/

assert.notDeepNestedInclude = function(exp, inc, msg) {
Expand All @@ -1115,13 +1115,13 @@ module.exports = function (chai, util) {

/**
* ### .ownInclude(haystack, needle, [message])
*
*
* Asserts that 'haystack' includes 'needle'.
* Can be used to assert the inclusion of a subset of properties in an
* Can be used to assert the inclusion of a subset of properties in an
* object while ignoring inherited properties.
*
*
* assert.ownInclude({ a: 1 }, { a: 1 });
*
*
* @name ownInclude
* @param {Object} haystack
* @param {Object} needle
Expand All @@ -1136,15 +1136,15 @@ module.exports = function (chai, util) {

/**
* ### .notOwnInclude(haystack, needle, [message])
*
*
* Asserts that 'haystack' includes 'needle'.
* Can be used to assert the absence of a subset of properties in an
* Can be used to assert the absence of a subset of properties in an
* object while ignoring inherited properties.
*
*
* Object.prototype.b = 2;
*
*
* assert.notOwnInclude({ a: 1 }, { b: 2 });
*
*
* @name notOwnInclude
* @param {Object} haystack
* @param {Object} needle
Expand All @@ -1159,13 +1159,13 @@ module.exports = function (chai, util) {

/**
* ### .deepOwnInclude(haystack, needle, [message])
*
*
* Asserts that 'haystack' includes 'needle'.
* Can be used to assert the inclusion of a subset of properties in an
* Can be used to assert the inclusion of a subset of properties in an
* object while ignoring inherited properties and checking for deep equality.
*
*
* assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}});
*
*
* @name deepOwnInclude
* @param {Object} haystack
* @param {Object} needle
Expand All @@ -1181,13 +1181,13 @@ module.exports = function (chai, util) {

/**
* ### .notDeepOwnInclude(haystack, needle, [message])
*
*
* Asserts that 'haystack' includes 'needle'.
* Can be used to assert the absence of a subset of properties in an
* Can be used to assert the absence of a subset of properties in an
* object while ignoring inherited properties and checking for deep equality.
*
*
* assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}});
*
*
* @name notDeepOwnInclude
* @param {Object} haystack
* @param {Object} needle
Expand Down Expand Up @@ -2645,7 +2645,7 @@ module.exports = function (chai, util) {
assert.increasesBy = function (fn, obj, prop, delta, msg) {
if (arguments.length === 4 && typeof obj === 'function') {
var tmpMsg = delta;
prop = null;
delta = prop;
msg = tmpMsg;
} else if (arguments.length === 3) {
delta = prop;
Expand Down Expand Up @@ -2705,8 +2705,9 @@ module.exports = function (chai, util) {

assert.increasesButNotBy = function (fn, obj, prop, delta, msg) {
if (arguments.length === 4 && typeof obj === 'function') {
msg = 'getter function';
prop = null;
var tmpMsg = delta;
delta = prop;
msg = tmpMsg;
} else if (arguments.length === 3) {
delta = prop;
prop = null;
Expand Down Expand Up @@ -2766,8 +2767,8 @@ module.exports = function (chai, util) {
assert.decreasesBy = function (fn, obj, prop, delta, msg) {
if (arguments.length === 4 && typeof obj === 'function') {
var tmpMsg = delta;
delta = prop;
msg = tmpMsg;
prop = null;
} else if (arguments.length === 3) {
delta = prop;
prop = null;
Expand Down Expand Up @@ -2859,8 +2860,9 @@ module.exports = function (chai, util) {

assert.decreasesButNotBy = function (fn, obj, prop, delta, msg) {
if (arguments.length === 4 && typeof obj === 'function') {
msg = 'getter function';
prop= null;
var tmpMsg = delta;
delta = prop;
msg = tmpMsg;
} else if (arguments.length === 3) {
delta = prop;
prop = null;
Expand Down

0 comments on commit d3d5b24

Please sign in to comment.