diff --git a/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js b/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js index e1c876bc71..1be3f9cf95 100644 --- a/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js +++ b/src/isomorphic/modern/class/__tests__/ReactES6Class-test.js @@ -55,8 +55,16 @@ describe('ReactES6Class', function() { }); it('throws if no render function is defined', function() { + spyOn(console, 'error'); class Foo extends React.Component { } expect(() => React.render(, container)).toThrow(); + expect(console.error.calls[0].args[0]).toBe( + 'Warning: Foo(...): ' + + 'No `render` method found on the returned component instance: you may ' + + 'have forgotten to define `render` in your component or you may have ' + + 'accidentally tried to render an element whose type is a function that ' + + 'isn\'t a React component.' + ); }); it('renders a simple stateless component with prop', function() {