Skip to content

Commit

Permalink
Added test to verify shallow renderer is shallow to ReactTestUtils-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Vaughn committed Apr 16, 2017
1 parent 219e6a7 commit 71bb1cd
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/renderers/dom/test/__tests__/ReactTestUtils-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,18 @@ describe('ReactTestUtils', () => {

// Shallow renderer only implemented for Fiber in 16+
if (ReactDOMFeatureFlags.useFiber) {
it('should only render 1 level deep', () => {
function Parent() {
return <div><Child/></div>
}
function Child() {
throw Error('This component should not render')
}

var shallowRenderer = createRenderer();
shallowRenderer.render(React.createElement(Parent));
});

it('should have shallow rendering', () => {
class SomeComponent extends React.Component {
render() {
Expand Down

0 comments on commit 71bb1cd

Please sign in to comment.