import { combineContext } from './context' ; describe ( 'combineContext' , ( ) => { test ( 'returns a combined context' , ( ) => { const context1 = { test : 'test' , } ; const context2 = { foo : 'bar' , } ; const expectedContext = { test : 'test' , foo : 'bar' , } ; const finalContext = combineContext ( context1 , context2 ) ; expect ( finalContext ) . toEqual ( expectedContext ) ; } ) ; test ( 'prefers values in second context' , ( ) => { const context1 = { test : 'test' , foo : 'baz' , } ; const context2 = { foo : 'bar' , } ; const expectedContext = { test : 'test' , foo : 'bar' , } ; const finalContext = combineContext ( context1 , context2 ) ; expect ( finalContext ) . toEqual ( expectedContext ) ; } ) ; } ) ;