Create package.json in your project directory with content:

2. Create your main component in src/index.js

import React from 'react'



export default function YourComponent (props) {

return (<div />)

}



3. Create tests for the component in src/index.test.js

/* eslint-env jest */

import React from 'react'

import { shallow } from 'enzyme'

import YourComponent from './index' describe('<YourComponent>', () => {

it('should render', () => {

const wrapper = shallow(<YourComponent />)

expect(wrapper.html()).toEqual('<div></div>')

})

})



4. Run: