diff --git a/src/renderers/dom/client/__tests__/findDOMNode-test.js b/src/renderers/dom/client/__tests__/findDOMNode-test.js index cdcc780683..1f861dd345 100644 --- a/src/renderers/dom/client/__tests__/findDOMNode-test.js +++ b/src/renderers/dom/client/__tests__/findDOMNode-test.js @@ -58,4 +58,17 @@ describe('findDOMNode', function() { ); }); + it('findDOMNode should not throw an error when called within a component that is not mounted', function() { + var Bar = React.createClass({ + componentWillMount: function() { + expect(ReactDOM.findDOMNode(this)).toBeNull(); + }, + render: function() { + return
; + }, + }); + + expect(() => ReactTestUtils.renderIntoDocument()).not.toThrow(); + }); + });