image.onload not working with jest, angular9

in this code, onload handler for image is not working , i dont have any clue why, need some help.

Basically this is part of more complex code.

 it('should trigger fake onload', fakeAsync(() => {
    var expected = new Image(); 
    expected.src= "base/test/img/canvas.png";

    expected.onload = (e) => {
      console.log('ddddd');
      flush();
      tick(3000);
    };
  }));

Source: Angular Questions