Skip to content

Instantly share code, notes, and snippets.

@adeelibr
Last active December 15, 2018 05:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adeelibr/ac60da132758c7ebbcb30e28672975fe to your computer and use it in GitHub Desktop.
Save adeelibr/ac60da132758c7ebbcb30e28672975fe to your computer and use it in GitHub Desktop.
Jest-Enzyme-Config-Article Part-5
import React from 'react';
import { shallow } from ‘enzyme’;
// Components
import WelcomeMessage from './WelcomeMessage';
function setup() {
const props = {
imgPath: 'some/image/path/to/a/mock/image',
};
const wrapper = shallow(<WelcomeMessage />);
return { wrapper, props };
}
describe('WelcomeMessage Test Suite', () => {
it('Should have an image', () => {
const { wrapper } = setup();
expect(wrapper.find('img').exists()).toBe(true);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment