Skip to content

Instantly share code, notes, and snippets.

@janhesters
Created September 16, 2018 18:47
Show Gist options
  • Save janhesters/561c1ae1817ab3ee52ded367dc39f734 to your computer and use it in GitHub Desktop.
Save janhesters/561c1ae1817ab3ee52ded367dc39f734 to your computer and use it in GitHub Desktop.
import App from './App';
import { shallow, ShallowWrapper } from 'enzyme';
import React from 'react';
import { View } from 'react-native';
const createTestProps = (props: Object) => ({
...props
});
describe("App", () => {
describe("rendering", () => {
let wrapper: ShallowWrapper;
let props: Object;
beforeEach(() => {
props = createTestProps({});
wrapper = shallow(<App {...props} />);
});
it("should render a <View />", () => {
expect(wrapper.find(View)).toHaveLength(1);
});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment