File tree Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Expand file tree Collapse file tree 3 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -105,5 +105,13 @@ describe('.addedDiff', () => {
105
105
expect ( addedDiff ( lhs , rhs ) ) . toEqual ( { date : new Date ( '2016' ) } ) ;
106
106
} ) ;
107
107
} ) ;
108
+
109
+ describe ( 'object with non-function hasOwnProperty property' , ( ) => {
110
+ test ( 'can represent the property in diff despite it being part of Object.prototype' , ( ) => {
111
+ const lhs = { } ;
112
+ const rhs = { hasOwnProperty : true } ;
113
+ expect ( addedDiff ( lhs , rhs ) ) . toEqual ( { hasOwnProperty : true } ) ;
114
+ } ) ;
115
+ } ) ;
108
116
} ) ;
109
117
} ) ;
Original file line number Diff line number Diff line change @@ -107,5 +107,13 @@ describe('.deletedDiff', () => {
107
107
expect ( deletedDiff ( { date : new Date ( '2016' ) } , rhs ) ) . toEqual ( { date : undefined } ) ;
108
108
} ) ;
109
109
} ) ;
110
+
111
+ describe ( 'object with non-function hasOwnProperty property' , ( ) => {
112
+ test ( 'can represent the property in diff despite it being part of Object.prototype' , ( ) => {
113
+ const lhs = { hasOwnProperty : true } ;
114
+ const rhs = { } ;
115
+ expect ( deletedDiff ( lhs , rhs ) ) . toEqual ( { hasOwnProperty : undefined } ) ;
116
+ } ) ;
117
+ } ) ;
110
118
} ) ;
111
119
} ) ;
Original file line number Diff line number Diff line change @@ -139,5 +139,13 @@ describe('.updatedDiff', () => {
139
139
expect ( updatedDiff ( lhs , rhs ) ) . toEqual ( { date : new Date ( '2017' ) } ) ;
140
140
} ) ;
141
141
} ) ;
142
+
143
+ describe ( 'object with non-function hasOwnProperty property' , ( ) => {
144
+ test ( 'can represent the property in diff despite it being part of Object.prototype' , ( ) => {
145
+ const lhs = { hasOwnProperty : false } ;
146
+ const rhs = { hasOwnProperty : true } ;
147
+ expect ( updatedDiff ( lhs , rhs ) ) . toEqual ( { hasOwnProperty : true } ) ;
148
+ } ) ;
149
+ } ) ;
142
150
} ) ;
143
151
} ) ;
You can’t perform that action at this time.
0 commit comments