title: Manually dispatchEvent DOMContentLoaded
body: <p>Is there any way to manually fire the <code>DOMContentLoaded</code> event?</p>
  <p>I'm trying to write a unit-test for some client-side JavaScript which does some stuff on the <code>DOMContentLoaded</code> event.</p>
  <p>The following did not work:</p>
  <pre><code>document.dispatchEvent(&quot;DOMContentLoaded&quot;)
  </code></pre>
  <p>or</p>
  <pre><code>document.body.dispatchEvent(&quot;DOMContentLoaded&quot;)
  </code></pre>