import { mergeTypeObject } from "../edit-type-utils" ; function merge ( oldType , newType , targetType ) { mergeTypeObject ( oldType , newType , targetType ) ; return targetType ; } test ( 'mergeTypeObjects' , ( ) => { expect ( merge ( { fields : [ { name : "field1" , test : "string" } , { name : "field2" , test : "string" } , { name : "field3" , test : "string" } , { name : "field4" , test : "string" } , { name : "field5" , test : "string" } , { name : "field6" , test : "string" } , { name : "field7" , test : "string" } ] } , { fields : [ { name : "field1" , test : "string1" } , { name : "field4" } , { name : "field4a" , test : "string4a" } , { name : "field5" , test : "string" , test2 : "bla" } , { name : "field6" , test : "string6" } , { name : "field7a" , test : "string" } , { name : "field8" , test : "string" } ] } , { fields : [ { oldName : "field1" , name : "field1" , test : "string" } , { oldName : "field4" , name : "field4a" , test : "string" } , { oldName : "field2" , name : "field2" , test : "string" } , { oldName : "field3" , name : "field3b" , test : "string2" } , { name : "newField" , test : "string3a" } , { oldName : "field5" , name : "field5" , test : "string5" } , { oldName : "field7" , name : "field7" , test : "string" } , { name : "field8" , test : "string8" } ] } ) ) . toEqual ( { fields : [ { oldName : "field1" , name : "field1" , test : "string1" } , { oldName : "field4" , name : "field4a" } , { oldName : "field4a" , name : "field4a" , test : "string4a" } , { name : "newField" , test : "string3a" } , { oldName : "field5" , name : "field5" , test : "string5" , test2 : "bla" } , { oldName : "field7a" , name : "field7a" , test : "string" } , { oldName : "field8" , name : "field8" , test : "string" } , { name : "field8" , test : "string8" } ] } ) ; } ) ;