From 243d24542354eae55a77ce68ea556e04a13967be Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Wed, 28 Dec 2016 00:22:34 +0000 Subject: [PATCH] Remove a duplicate test This test is identical to "should warn when stateless component returns array" earlier. It was moved from another file in #5884 so it likely survived by accident. --- .../__tests__/ReactStatelessComponent-test.js | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js b/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js index 3a64a26d9cb7f..2dd8158ec7ec3 100644 --- a/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js +++ b/src/renderers/shared/shared/__tests__/ReactStatelessComponent-test.js @@ -271,18 +271,4 @@ describe('ReactStatelessComponent', () => { expect(() => ReactTestUtils.renderIntoDocument()).not.toThrow(); }); - it('should warn when using non-React functions in JSX', () => { - spyOn(console, 'error'); - function NotAComponent() { - return [
,
]; - } - expect(function() { - ReactTestUtils.renderIntoDocument(
); - }).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.' - ); - }); });