title: window.alert not implemented when running tests
body: <p>I am trying to experiment some with the jest tester for react and when I do an <code>npm test</code>, the test passes ok, but I get this error:</p>
  
  <pre><code>Snapshots:   0 total
    console.error node_modules/jsdom/lib/jsdom/virtual-console.js:29
      Error: Not implemented: window.alert
  </code></pre>
  
  <p>I know this is due to the fact that I an alert call in my code because if I comment that alert call out I don't get the error.</p>
  
  <p>I tried the solution mentioned <a href="https://stackoverflow.com/questions/53611098/how-can-i-mock-the-window-alert-method-in-jest">here</a> but I still get the error.  Is there any way I can eliminate this error while still keeping the alert call in my code?</p>
  
  <p>Here's the test:</p>
  
  <pre><code>it('renders without crashing', () =&gt; {
    jest.spyOn(window, 'alert').mockImplementation(() =&gt; {});
    const div = document.createElement('div');
    ReactDOM.render(&lt;App /&gt;, div);
    ReactDOM.unmountComponentAtNode(div);
  });
  </code></pre>