title: Testing ModalController Ionic 3 spyOn method not called
body: <p>I am trying to test a method that launch a modal, has anybody done this before, can someone perhaps point me in the right direction?? I have written the following test suite.</p>
  
  <pre><code>describe('bdb modal provider test suite', () =&gt; {
  
  let bdbModal: BdbModalProvider;
  let modal: Modal;
  let modalCtrl: ModalController;
  
  beforeEach(() =&gt; {
      TestBed.configureTestingModule({
          providers: [
              BdbModalProvider,
              { provide: ModalController, useClass: ModalControllerMock }
          ]
      });
      bdbModal = TestBed.get(BdbModalProvider);
      modalCtrl = TestBed.get(ModalController);
  });
  
  beforeEach(() =&gt; {
      modal = modalCtrl.create('ModalErrorPage', {});
  });
  
  it('should launch error modal', () =&gt; {
      spyOn(modal, 'present');
      bdbModal.launchErrModal('testing', 'error modal', 'OK');
      expect(modal.present).toHaveBeenCalled();
  });
  });
  </code></pre>
  
  <p>this is the error log:</p>
  
  <blockquote>
    <p>should launch error modal
         bdb modal provider test suite
         Expected spy present to have been called.
        at UserContext. (webpack:///src/providers/bdb-modal/bdb-modal.spec.ts:31:30 &lt;- test-config/karma-test-shim.js:140545:31)</p>
  </blockquote>