import { deepStrictEqual , strictEqual } from 'assert' ; import { IApiTag } from '../interfaces' ; import { mergeTags } from './merge-tags' ; describe ( 'mergeTags should merge the tags' , ( ) => { it ( 'when tags1 is undefined and tags2 is not.' , ( ) => { const tags1 = undefined ; const tags2 = [ { name : 'A' } ] ; const tags = mergeTags ( tags1 , tags2 ) ; deepStrictEqual ( tags , [ { name : 'A' } ] ) ; } ) ; it ( 'when tags2 is undefined and tags1 is not.' , ( ) => { const tags1 = [ { name : 'A' } ] ; const tags2 = undefined ; const tags = mergeTags ( tags1 , tags2 ) ; deepStrictEqual ( tags , [ { name : 'A' } ] ) ; } ) ; it ( 'when both tags1 and tags2 are undefined.' , ( ) => { const tags1 = undefined ; const tags2 = undefined ; const tags = mergeTags ( tags1 , tags2 ) ; strictEqual ( tags , undefined ) ; } ) ; it ( 'when both tags1 and tags2 are defined.' , ( ) => { const tags1 = [ { name : 'A' } ] ; const tags2 = [ { name : 'B' } ] ; const tags = mergeTags ( tags1 , tags2 ) ; deepStrictEqual ( tags , [ { name : 'A' } , { name : 'B' } ] ) ; } ) ; } ) ;