Testing if an event has been triggered in Jasmine : <p>How do you test if an event has been fired in Jasmine without <code>jquery-jasmine</code>? </p>

<p>I'm working on a project where we don't use jQuery (wohoo), and I'm trying to write a unit test for my menu triggering function. It works like this:</p>

<ul>
<li>You click a button</li>
<li>My testable component then runs <code>document.dispatchEvent(new CustomEvent('menu.toggle'))</code></li>
<li>I want to test that the component indeed dispatched the custom event. </li>
</ul>

<p>How do I test this?</p>
