title: Jest how to verify function is called on DOMContentLoaded event
body: <p>I need to write unit test for following code. I need to check initCarousel is called on document load
  // carousel.js</p>
  <pre><code>document.addEventListner('DOMContentLoaded', () =&gt; {
      initCarousel();
  });
  </code></pre>