Skip to content

Instantly share code, notes, and snippets.

@kojinkai
Created February 21, 2018 16:31
Show Gist options
  • Save kojinkai/a30f0ac1a4740576468afb9214c1033c to your computer and use it in GitHub Desktop.
Save kojinkai/a30f0ac1a4740576468afb9214c1033c to your computer and use it in GitHub Desktop.
import React from 'react';
import { shallow, mount } from 'enzyme';
import { shallowWithIntl, mountWithIntl } from './react-intl';
const componentWrapper = renderer => (Component, defaultProps) => props => renderer(
<Component
{...defaultProps}
{...props}
/>,
);
export const createWithShallow = componentWrapper(shallow);
export const createWithMount = componentWrapper(mount);
export const createWithShallowWithIntl = componentWrapper(shallowWithIntl);
export const createWithMountWithIntl = componentWrapper(mountWithIntl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment