title: react testing library - test window.addEventListener('resize')
body: <p>I am using jest &amp; react-testing-library.
  In my component on didMount I add an event listener to the window reacting on resize events. Based on resize events, another function is called. In my test, that function is mocked.</p>
  <p>Now I have the problem, that I am not able to trigger these resize events.
  Is there any way to get that done?</p>
  <pre><code>   window.resizeTo(500, 500);
     fireEvent.resize(window);
     fireEvent(window, new Event(&quot;resize&quot;));
  </code></pre>
  <p>I tried to achieve the triggering of the event listener on different ways, but nothing worked.</p>
  <p>Thanks for your help in advance :)</p>