@@ -1013,7 +1013,7 @@ module.exports = function (chai, util) {
1013
1013
} ;
1014
1014
1015
1015
/**
1016
- * ### .nestedInclude
1016
+ * ### .nestedInclude(targetObj, nestedObject, [msg])
1017
1017
*
1018
1018
* Asserts that 'targetObject' includes 'nestedObject'.
1019
1019
* Enables the use of dot- and bracket-notation for referencing nested properties.
@@ -1035,7 +1035,7 @@ module.exports = function (chai, util) {
1035
1035
} ;
1036
1036
1037
1037
/**
1038
- * ### .notNestedInclude
1038
+ * ### .notNestedInclude(targetObj, nestedObj, [msg])
1039
1039
*
1040
1040
* Asserts that 'targetObject' does not include 'nestedObject'.
1041
1041
* Enables the use of dot- and bracket-notation for referencing nested properties.
@@ -1057,6 +1057,50 @@ module.exports = function (chai, util) {
1057
1057
new Assertion ( exp , msg , assert . notNestedInclude , true ) . not . nested . include ( inc ) ;
1058
1058
} ;
1059
1059
1060
+ /**
1061
+ * ### .deepNestedInclude(targetObject, nestedObject, [msg])
1062
+ *
1063
+ * Asserts that 'targetObj' includes 'nestedObject' while checking for deep equality.
1064
+ * Enables the user of dot- and bracket-notation for referencing nested properties.
1065
+ * '[]' and '.' in property names can be escaped using double backslashes.
1066
+ *
1067
+ * assert.deepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {x: 1}})
1068
+ * assert.deepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {x: 1}});
1069
+ *
1070
+ * @name deepNestedInclude
1071
+ * @param {Object } targetObject
1072
+ * @param {Object } nestedObject
1073
+ * @param {String } message
1074
+ * @namespace Assert
1075
+ * @api public
1076
+ */
1077
+
1078
+ assert . deepNestedInclude = function ( exp , inc , msg ) {
1079
+ new Assertion ( exp , msg , assert . deepNestedInclude , true ) . deep . nested . include ( inc ) ;
1080
+ } ;
1081
+
1082
+ /**
1083
+ * ### .notDeepNestedInclude(targetObject, nestedObject, [msg])
1084
+ *
1085
+ * Asserts that 'targetObj' does not include 'nestedObject' while checking for deep equality.
1086
+ * Enables the user of dot- and bracket-notation for referencing nested properties.
1087
+ * '[]' and '.' in property names can be escaped using double backslashes.
1088
+ *
1089
+ * assert.notDeepNestedInclude({a: {b: [{x: 1}]}}, {'a.b[0]': {y: 1}})
1090
+ * assert.notDeepNestedInclude({'.a': {'[b]': {x: 1}}}, {'\\.a.\\[b\\]': {y: 2}});
1091
+ *
1092
+ * @name notDeepNestedInclude
1093
+ * @param {Object } targetObject
1094
+ * @param {Object } nestedObject
1095
+ * @param {String } message
1096
+ * @namespace Assert
1097
+ * @api public
1098
+ */
1099
+
1100
+ assert . notDeepNestedInclude = function ( exp , inc , msg ) {
1101
+ new Assertion ( exp , msg , assert . notDeepNestedInclude , true ) . not . deep . nested . include ( inc ) ;
1102
+ } ;
1103
+
1060
1104
/**
1061
1105
* ### .match(value, regexp, [message])
1062
1106
*
0 commit comments