title: Testing Image onload using jsdom, sinon, mocha and chai
body: <p>Can anyone help me with testing of following function</p>
  
  <pre><code>function onload(cb){
    const image = 'http://placehold.it/350x150'
    const img = new Image()
    img.src = image
    img.onload = () =&gt; {
      cb()
    }
  }
  </code></pre>
  
  <p>In my test file <code>Image</code> is available via jsdom. I want that I can test that <code>cb</code> is calledOnce</p>