title: Test with reactjs renderIntoDocument keep failed due to required DOM
body: <p>I am new to reactJS and try to learn how to test with it. I have encouter the following testing util method. However i am keep getting the same error <code>message:ReferenceError: document is not defined</code>. </p>
  
  <hr>
  
  <p><strong>renderIntoDocument</strong></p>
  
  <pre><code>ReactComponent renderIntoDocument(
    ReactElement instance
  )
  </code></pre>
  
  <p>Render a component into a detached DOM node in the document. This function requires a DOM.</p>
  
  <p>Note:
  You will need to have window, window.document and window.document.createElement globally available before you import React. Otherwise React will think it can't access the DOM and methods like setState won't work.</p>
  
  <hr>
  
  <p>I know it the reason failing its missing the DOM, but how can i insert the DOM or require it?</p>
  
  <hr>
  
  <p>My test below:</p>
  
  <pre><code>import expect from 'expect.js';
  import React from 'react';
  import Header from '../../components/header';
  import {renderShallow} from './help';
  import ReactAddOn from 'react/addons';
  
  var TestUtils = ReactAddOn.addons.TestUtils;
  
  describe('Test react', function() {
    let component;
  
    beforeEach(()=&gt;{
      component = TestUtils.renderIntoDocument(&lt;Header&gt;&lt;/Header&gt;);
    });
  
  
    it('Test if the content been correclty render', function() {
      console.log(component);
    });
  });
  </code></pre>