@@ -401,6 +401,34 @@ describe('subsetEquality()', () => {
401401 } ) ;
402402 } ) ;
403403 } ) ;
404+
405+ describe ( 'subset is not object with keys' , ( ) => {
406+ test ( 'returns true if subset has keys' , ( ) => {
407+ expect ( subsetEquality ( { foo : 'bar' } , { foo : 'bar' } ) ) . toBe ( true ) ;
408+ } ) ;
409+ test ( 'returns true if subset has Symbols' , ( ) => {
410+ const symbol = Symbol ( 'foo' ) ;
411+ expect ( subsetEquality ( { [ symbol ] : 'bar' } , { [ symbol ] : 'bar' } ) ) . toBe ( true ) ;
412+ } ) ;
413+ test ( 'returns undefined if subset has no keys' , ( ) => {
414+ expect ( subsetEquality ( 'foo' , 'bar' ) ) . toBeUndefined ( ) ;
415+ } ) ;
416+ test ( 'returns undefined if subset is null' , ( ) => {
417+ expect ( subsetEquality ( { foo : 'bar' } , null ) ) . toBeUndefined ( ) ;
418+ } ) ;
419+ test ( 'returns undefined if subset is Error' , ( ) => {
420+ expect ( subsetEquality ( { foo : 'bar' } , new Error ( ) ) ) . toBeUndefined ( ) ;
421+ } ) ;
422+ test ( 'returns undefined if subset is Array' , ( ) => {
423+ expect ( subsetEquality ( { foo : 'bar' } , [ ] ) ) . toBeUndefined ( ) ;
424+ } ) ;
425+ test ( 'returns undefined if subset is Date' , ( ) => {
426+ expect ( subsetEquality ( { foo : 'bar' } , new Date ( ) ) ) . toBeUndefined ( ) ;
427+ } ) ;
428+ test ( 'returns undefined if subset is Set' , ( ) => {
429+ expect ( subsetEquality ( { foo : 'bar' } , new Set ( ) ) ) . toBeUndefined ( ) ;
430+ } ) ;
431+ } ) ;
404432} ) ;
405433
406434describe ( 'iterableEquality' , ( ) => {
0 commit comments