Check for warning when testing to see if error is thrown when render not defined

This commit is contained in:
Battaile Fauber
2015-06-24 08:03:36 -04:00
parent e80cccf87f
commit 41df3ce421
@@ -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(<Foo />, 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() {