Skip to content

Commit

Permalink
Remove a duplicate test
Browse files Browse the repository at this point in the history
This test is identical to "should warn when stateless component returns array" earlier.

It was moved from another file in facebook#5884 so it likely survived by accident.
  • Loading branch information
gaearon authored and acdlite committed Jan 12, 2017
1 parent fdf0f43 commit 33c3121
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -388,18 +388,4 @@ describe('ReactStatelessComponent', () => {
expect(() => ReactTestUtils.renderIntoDocument(<Child />)).not.toThrow();
});

it('should warn when using non-React functions in JSX', () => {
spyOn(console, 'error');
function NotAComponent() {
return [<div />, <div />];
}
expect(function() {
ReactTestUtils.renderIntoDocument(<div><NotAComponent /></div>);
}).toThrow(); // has no method 'render'
expectDev(console.error.calls.count()).toBe(1);
expectDev(console.error.calls.argsFor(0)[0]).toContain(
'NotAComponent(...): A valid React element (or null) must be returned. You may ' +
'have returned undefined, an array or some other invalid object.'
);
});
});

0 comments on commit 33c3121

Please sign in to comment.