@@ -1012,49 +1012,49 @@ module.exports = function (chai, util) {
1012
1012
1013
1013
/**
1014
1014
* ### .nestedInclude(haystack, needle, [message])
1015
- *
1016
- * Asserts that 'haystack' includes 'needle'.
1017
- * Can be used to assert the inclusion of a subset of properties in an
1015
+ *
1016
+ * Asserts that 'haystack' includes 'needle'.
1017
+ * Can be used to assert the inclusion of a subset of properties in an
1018
1018
* object.
1019
- * Enables the use of dot- and bracket-notation for referencing nested
1019
+ * Enables the use of dot- and bracket-notation for referencing nested
1020
1020
* properties.
1021
1021
* '[]' and '.' in property names can be escaped using double backslashes.
1022
- *
1022
+ *
1023
1023
* assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
1024
1024
* assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
1025
- *
1025
+ *
1026
1026
* @name nestedInclude
1027
1027
* @param {Object } haystack
1028
1028
* @param {Object } needle
1029
1029
* @param {String } message
1030
1030
* @namespace Assert
1031
- * @api public
1032
- */
1031
+ * @api public
1032
+ */
1033
1033
1034
1034
assert . nestedInclude = function ( exp , inc , msg ) {
1035
1035
new Assertion ( exp , msg , assert . nestedInclude , true ) . nested . include ( inc ) ;
1036
1036
} ;
1037
1037
1038
1038
/**
1039
1039
* ### .notNestedInclude(haystack, needle, [message])
1040
- *
1041
- * Asserts that 'haystack' does not include 'needle'.
1042
- * Can be used to assert the absence of a subset of properties in an
1040
+ *
1041
+ * Asserts that 'haystack' does not include 'needle'.
1042
+ * Can be used to assert the absence of a subset of properties in an
1043
1043
* object.
1044
- * Enables the use of dot- and bracket-notation for referencing nested
1045
- * properties.
1044
+ * Enables the use of dot- and bracket-notation for referencing nested
1045
+ * properties.
1046
1046
* '[]' and '.' in property names can be escaped using double backslashes.
1047
- *
1047
+ *
1048
1048
* assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.b': 'y'});
1049
1049
* assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
1050
- *
1050
+ *
1051
1051
* @name notNestedInclude
1052
1052
* @param {Object } haystack
1053
1053
* @param {Object } needle
1054
1054
* @param {String } message
1055
1055
* @namespace Assert
1056
- * @api public
1057
- */
1056
+ * @api public
1057
+ */
1058
1058
1059
1059
assert . notNestedInclude = function ( exp , inc , msg ) {
1060
1060
new Assertion ( exp , msg , assert . notNestedInclude , true )
@@ -1063,23 +1063,23 @@ module.exports = function (chai, util) {
1063
1063
1064
1064
/**
1065
1065
* ### .deepNestedInclude(haystack, needle, [message])
1066
- *
1066
+ *
1067
1067
* Asserts that 'haystack' includes 'needle'.
1068
- * Can be used to assert the inclusion of a subset of properties in an
1068
+ * Can be used to assert the inclusion of a subset of properties in an
1069
1069
* object while checking for deep equality.
1070
- * Enables the use of dot- and bracket-notation for referencing nested
1070
+ * Enables the use of dot- and bracket-notation for referencing nested
1071
1071
* properties.
1072
1072
* '[]' and '.' in property names can be escaped using double backslashes.
1073
- *
1073
+ *
1074
1074
* assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}});
1075
1075
* assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
1076
- *
1076
+ *
1077
1077
* @name deepNestedInclude
1078
1078
* @param {Object } haystack
1079
1079
* @param {Object } needle
1080
1080
* @param {String } message
1081
1081
* @namespace Assert
1082
- * @api public
1082
+ * @api public
1083
1083
*/
1084
1084
1085
1085
assert . deepNestedInclude = function ( exp , inc , msg ) {
@@ -1089,23 +1089,23 @@ module.exports = function (chai, util) {
1089
1089
1090
1090
/**
1091
1091
* ### .notDeepNestedInclude(haystack, needle, [message])
1092
- *
1092
+ *
1093
1093
* Asserts that 'haystack' does not include 'needle'.
1094
- * Can be used to assert the absence of a subset of properties in an
1094
+ * Can be used to assert the absence of a subset of properties in an
1095
1095
* object while checking for deep equality.
1096
- * Enables the use of dot- and bracket-notation for referencing nested
1096
+ * Enables the use of dot- and bracket-notation for referencing nested
1097
1097
* properties.
1098
1098
* '[]' and '.' in property names can be escaped using double backslashes.
1099
- *
1099
+ *
1100
1100
* assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
1101
1101
* assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
1102
- *
1102
+ *
1103
1103
* @name notDeepNestedInclude
1104
1104
* @param {Object } haystack
1105
1105
* @param {Object } needle
1106
1106
* @param {String } message
1107
1107
* @namespace Assert
1108
- * @api public
1108
+ * @api public
1109
1109
*/
1110
1110
1111
1111
assert . notDeepNestedInclude = function ( exp , inc , msg ) {
@@ -1115,13 +1115,13 @@ module.exports = function (chai, util) {
1115
1115
1116
1116
/**
1117
1117
* ### .ownInclude(haystack, needle, [message])
1118
- *
1118
+ *
1119
1119
* Asserts that 'haystack' includes 'needle'.
1120
- * Can be used to assert the inclusion of a subset of properties in an
1120
+ * Can be used to assert the inclusion of a subset of properties in an
1121
1121
* object while ignoring inherited properties.
1122
- *
1122
+ *
1123
1123
* assert.ownInclude({ a: 1 }, { a: 1 });
1124
- *
1124
+ *
1125
1125
* @name ownInclude
1126
1126
* @param {Object } haystack
1127
1127
* @param {Object } needle
@@ -1136,15 +1136,15 @@ module.exports = function (chai, util) {
1136
1136
1137
1137
/**
1138
1138
* ### .notOwnInclude(haystack, needle, [message])
1139
- *
1139
+ *
1140
1140
* Asserts that 'haystack' includes 'needle'.
1141
- * Can be used to assert the absence of a subset of properties in an
1141
+ * Can be used to assert the absence of a subset of properties in an
1142
1142
* object while ignoring inherited properties.
1143
- *
1143
+ *
1144
1144
* Object.prototype.b = 2;
1145
- *
1145
+ *
1146
1146
* assert.notOwnInclude({ a: 1 }, { b: 2 });
1147
- *
1147
+ *
1148
1148
* @name notOwnInclude
1149
1149
* @param {Object } haystack
1150
1150
* @param {Object } needle
@@ -1159,13 +1159,13 @@ module.exports = function (chai, util) {
1159
1159
1160
1160
/**
1161
1161
* ### .deepOwnInclude(haystack, needle, [message])
1162
- *
1162
+ *
1163
1163
* Asserts that 'haystack' includes 'needle'.
1164
- * Can be used to assert the inclusion of a subset of properties in an
1164
+ * Can be used to assert the inclusion of a subset of properties in an
1165
1165
* object while ignoring inherited properties and checking for deep equality.
1166
- *
1166
+ *
1167
1167
* assert.deepOwnInclude({a: {b: 2}}, {a: {b: 2}});
1168
- *
1168
+ *
1169
1169
* @name deepOwnInclude
1170
1170
* @param {Object } haystack
1171
1171
* @param {Object } needle
@@ -1181,13 +1181,13 @@ module.exports = function (chai, util) {
1181
1181
1182
1182
/**
1183
1183
* ### .notDeepOwnInclude(haystack, needle, [message])
1184
- *
1184
+ *
1185
1185
* Asserts that 'haystack' includes 'needle'.
1186
- * Can be used to assert the absence of a subset of properties in an
1186
+ * Can be used to assert the absence of a subset of properties in an
1187
1187
* object while ignoring inherited properties and checking for deep equality.
1188
- *
1188
+ *
1189
1189
* assert.notDeepOwnInclude({a: {b: 2}}, {a: {c: 3}});
1190
- *
1190
+ *
1191
1191
* @name notDeepOwnInclude
1192
1192
* @param {Object } haystack
1193
1193
* @param {Object } needle
@@ -2645,7 +2645,7 @@ module.exports = function (chai, util) {
2645
2645
assert . increasesBy = function ( fn , obj , prop , delta , msg ) {
2646
2646
if ( arguments . length === 4 && typeof obj === 'function' ) {
2647
2647
var tmpMsg = delta ;
2648
- prop = null ;
2648
+ delta = prop ;
2649
2649
msg = tmpMsg ;
2650
2650
} else if ( arguments . length === 3 ) {
2651
2651
delta = prop ;
@@ -2705,8 +2705,9 @@ module.exports = function (chai, util) {
2705
2705
2706
2706
assert . increasesButNotBy = function ( fn , obj , prop , delta , msg ) {
2707
2707
if ( arguments . length === 4 && typeof obj === 'function' ) {
2708
- msg = 'getter function' ;
2709
- prop = null ;
2708
+ var tmpMsg = delta ;
2709
+ delta = prop ;
2710
+ msg = tmpMsg ;
2710
2711
} else if ( arguments . length === 3 ) {
2711
2712
delta = prop ;
2712
2713
prop = null ;
@@ -2766,8 +2767,8 @@ module.exports = function (chai, util) {
2766
2767
assert . decreasesBy = function ( fn , obj , prop , delta , msg ) {
2767
2768
if ( arguments . length === 4 && typeof obj === 'function' ) {
2768
2769
var tmpMsg = delta ;
2770
+ delta = prop ;
2769
2771
msg = tmpMsg ;
2770
- prop = null ;
2771
2772
} else if ( arguments . length === 3 ) {
2772
2773
delta = prop ;
2773
2774
prop = null ;
@@ -2859,8 +2860,9 @@ module.exports = function (chai, util) {
2859
2860
2860
2861
assert . decreasesButNotBy = function ( fn , obj , prop , delta , msg ) {
2861
2862
if ( arguments . length === 4 && typeof obj === 'function' ) {
2862
- msg = 'getter function' ;
2863
- prop = null ;
2863
+ var tmpMsg = delta ;
2864
+ delta = prop ;
2865
+ msg = tmpMsg ;
2864
2866
} else if ( arguments . length === 3 ) {
2865
2867
delta = prop ;
2866
2868
prop = null ;
0 commit comments