import { shallow } from 'enzyme' ; jest . mock ( '@elastic/eui' , ( ) => { return { EuiContext : function MockEuiContext ( ) { } , } ; } ) ; jest . mock ( '@osd/i18n/react' , ( ) => { return { I18nProvider : function MockI18nProvider ( ) { } , } ; } ) ; import React from 'react' ; import { I18nService } from './i18n_service' ; afterEach ( ( ) => { jest . clearAllMocks ( ) ; jest . resetModules ( ) ; } ) ; describe ( '#start()' , ( ) => { it ( 'returns `Context` component' , ( ) => { const i18nService = new I18nService ( ) ; const i18n = i18nService . start ( ) ; expect ( shallow ( < i18n . Context > content < /i18n.Context>)).toMatchSnapshot(); } ) ; } ) ;