import React from 'react' ; import { mount } from 'enzyme' ; import { I18nProvider } from '@kbn/i18n-react' ; /**
 * This helper wraps a component with @kbn/i18n's <I18nProvider> which
 * fixes "Could not find required `intl` object" console errors when running tests
 *
 * Example usage (should be the same as mount()):
 *
 * const wrapper = mountWithI18n(<Component />);
 */ export const mountWithIntl = ( children ) => { return mount ( < I18nProvider > { children } < /I18nProvider>); } ;