File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -133,5 +133,18 @@ describe('getDiff', () => {
133
133
assert . equal ( differenceFrom . a . from , null ) ;
134
134
assert . equal ( differenceTo . a . to , null ) ;
135
135
} ) ;
136
+
137
+ it ( 'should detect comparisons with defined undefined' , ( ) => {
138
+ const differenceFrom = diffler ( { a : undefined , b : 'things' } , { a : 'more' , b : 'things' } ) ;
139
+ const differenceTo = diffler ( { a : 'some' , b : 'things' } , { a : undefined , b : 'things' } ) ;
140
+ const same = diffler ( { a : undefined , b : 'things' } , { a : undefined , b : 'things' } ) ;
141
+
142
+ assert . equal ( Object . keys ( differenceFrom ) . length , 1 ) ;
143
+ assert . equal ( Object . keys ( differenceTo ) . length , 1 ) ;
144
+ assert . equal ( Object . keys ( same ) . length , 0 ) ;
145
+
146
+ assert . equal ( differenceFrom . a . from , undefined ) ;
147
+ assert . equal ( differenceTo . a . to , undefined ) ;
148
+ } ) ;
136
149
} ) ;
137
150
} ) ;
You can’t perform that action at this time.
0 commit comments