1import ShallowRenderer from 'react-test-renderer/shallow';
2
3// in your test:
4const renderer = new ShallowRenderer();
5renderer.render(<MyComponent />);
6const result = renderer.getRenderOutput();
7
8expect(result.type).toBe('div');
9expect(result.props.children).toEqual([
10 <span className="heading">Title</span>,
11 <Subcomponent foo="bar" />
12]);