jest.unmock('./Foo'); import React from 'react'; import { shallow, mount, render } from 'enzyme'; import { renderIntoDocument } from 'react-addons-test-utils'; import Foo from './Foo'; import Bar from './Bar'; // Jest automocking doesn't work right away with stateless components, i.e. you have to force // them to return a renderable value. // As it turns out state*full* components only work because of a hack in React: // https://github.com/facebook/react/blob/6b1232aa86415f0573153888a46c4c5cb38974d8/src/renderers/shared/stack/reconciler/ReactCompositeComponent.js#L1103 Bar.mockImplementation(() =>
); // React 0.14 // Bar.mockImplementation(() => null); // React 15 Error.stackTraceLimit = 10; describe('components/Foo', () => { describe('rendering methods', () => { it('Shallow Rendering - shallow', () => { console.log('Shallow Rendering - shallow'); // constructor // componentWillMount // render // setProps() // componentWillReceiveProps // shouldComponentUpdate // componentWillUpdate // render const wrapper = shallow(