@@ -824,6 +824,28 @@ describe('assert', function () {
824
824
} , "expected { a: 1 } to not have own property 'a' of 1" ) ;
825
825
} ) ;
826
826
827
+ it ( 'deepOwnInclude and notDeepOwnInclude' , function ( ) {
828
+ assert . deepOwnInclude ( { a : { b : 2 } } , { a : { b : 2 } } ) ;
829
+ assert . notDeepOwnInclude ( { a : { b : 2 } } , { a : { c : 3 } } ) ;
830
+ assert . notDeepOwnInclude ( { a : { b : 2 } } , { 'toString' : Object . prototype . toString } ) ;
831
+
832
+ err ( function ( ) {
833
+ assert . deepOwnInclude ( { a : { b : 2 } } , { a : { c : 3 } } , 'blah' ) ;
834
+ } , "blah: expected { a: { b: 2 } } to have deep own property 'a' of { c: 3 }, but got { b: 2 }" ) ;
835
+
836
+ err ( function ( ) {
837
+ assert . deepOwnInclude ( { a : { b : 2 } } , 'blah' , { a : { c : 3 } } ) ;
838
+ } , "blah: expected { a: { b: 2 } } to have deep own property 'a' of { c: 3 }, but got { b: 2 }" ) ;
839
+
840
+ err ( function ( ) {
841
+ assert . deepOwnInclude ( { a : { b : 2 } } , { 'toString' : Object . prototype . toString } ) ;
842
+ } , "expected { a: { b: 2 } } to have deep own property 'toString'" ) ;
843
+
844
+ err ( function ( ) {
845
+ assert . notDeepOwnInclude ( { a : { b : 2 } } , { a : { b : 2 } } ) ;
846
+ } , "expected { a: { b: 2 } } to not have deep own property 'a' of { b: 2 }" ) ;
847
+ } ) ;
848
+
827
849
it ( 'keys(array|Object|arguments)' , function ( ) {
828
850
assert . hasAllKeys ( { foo : 1 } , [ 'foo' ] ) ;
829
851
assert . hasAllKeys ( { foo : 1 , bar : 2 } , [ 'foo' , 'bar' ] ) ;
0 commit comments