@@ -1012,6 +1012,51 @@ module.exports = function (chai, util) {
1012
1012
new Assertion ( exp , msg , assert . notDeepInclude , true ) . not . deep . include ( inc ) ;
1013
1013
} ;
1014
1014
1015
+ /**
1016
+ * ### .nestedInclude
1017
+ *
1018
+ * Asserts that 'targetObject' includes 'nestedObject'.
1019
+ * Enables the use of dot- and bracket-notation for referencing nested properties.
1020
+ * '[]' and '.' in property names can be escaped using double backslashes.
1021
+ *
1022
+ * assert.nestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'x'});
1023
+ * assert.nestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'x'});
1024
+ *
1025
+ * @name nestedInclude
1026
+ * @param {Object } targetObject
1027
+ * @param {Object } nestedObject
1028
+ * @param {String } message
1029
+ * @namespace Assert
1030
+ * @api public
1031
+ */
1032
+
1033
+ assert . nestedInclude = function ( exp , inc , msg ) {
1034
+ new Assertion ( exp , msg , assert . nestedInclude , true ) . nested . include ( inc ) ;
1035
+ } ;
1036
+
1037
+ /**
1038
+ * ### .notNestedInclude
1039
+ *
1040
+ * Asserts that 'targetObject' does not include 'nestedObject'.
1041
+ * Enables the use of dot- and bracket-notation for referencing nested properties.
1042
+ * '[]' and '.' in property names can be escaped using double backslashes.
1043
+ *
1044
+ * assert.notNestedInclude({'.a': {'b': 'x'}}, {'\\.a.[b]': 'y'});
1045
+ * assert.notNestedInclude({'a': {'[b]': 'x'}}, {'a.\\[b\\]': 'y'});
1046
+ *
1047
+ *
1048
+ * @name notNestedInclude
1049
+ * @param {Object } targetObject
1050
+ * @param {Object } nestedObject
1051
+ * @param {String } message
1052
+ * @namespace Assert
1053
+ * @api public
1054
+ */
1055
+
1056
+ assert . notNestedInclude = function ( exp , inc , msg ) {
1057
+ new Assertion ( exp , msg , assert . notNestedInclude , true ) . not . nested . include ( inc ) ;
1058
+ } ;
1059
+
1015
1060
/**
1016
1061
* ### .match(value, regexp, [message])
1017
1062
*
0 commit comments