Skip to content
Haz edited this page Mar 13, 2017 · 3 revisions

ARc uses Jest and Enzyme for testing components.

Each test file lives inside the component folder with a standard name (index.test.js). That's a basic and common test:

import React from 'react'
import { shallow } from 'enzyme'
import Component from '.'

it('renders children when passed in', () => {
  const wrapper = shallow(<Component>test</Component>)
  expect(wrapper.contains('test')).toBe(true)
})
Clone this wiki locally