How to collect coverage of image onload?

I'm using React to draw a canvas with images drawed by drawImage. Everything works ok but I can't collect the coverage of onload function when UT for it. Anyone have a solution?

componentDidMount() {
  const ctx = this.canvas.getContext('2d');
  const img = new Image();
  img.src = testImg;
  img.onload = () => {
    ctx.drawImage(img, 0, 0);
  };
}
render() {
  return (
    <article>
      <Helmet>
        <title>Home Page</title>
        <meta name="description" content="A React.js Boilerplate application homepage" />
      </Helmet>
      <div>
        <Section>
          <canvas
            width="400px"
            height="400px"
            ref={(canvas) => this.canvas = canvas} // eslint-disable-line
            style={{ border: '1px solid #000000', marginTop: '20px' }}
          />
        </Section>
      </div>
    </article>
  );
}

And the coverage result

enter image description here