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 committed Dec 28, 2016
1 parent da3dc03 commit 243d245
Showing 1 changed file with 0 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,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 243d245

Please sign in to comment.