title: How to resolve 'calls' does not exist on type '() => any'
body: <p>Testing my angular2 app.  I try and set a spy and then check how many times it has been called.  I keep getting this TS error though</p>
  
  <blockquote>
    <p>Property 'calls' does not exist on type '() => any'.</p>
  </blockquote>
  
  <p><strong><em>How Do I resolve this error?</em></strong></p>
  
  <pre><code>describe('ssh Service', () =&gt; {
      let ref:SshRefService;
  
      beforeEach(() =&gt; {
          TestBed.configureTestingModule({
              providers: [
                  { provide: SshRefService, useClass: refClass },
              ]
          });
  
      });
  
      beforeEach(inject([SshRefService], (sshRef:SshRefService) =&gt; {
          ref = sshRef
          spyOn(ref, 'getClient').and.returnValue(true)
      }));
  
      it('should mock an observable', () =&gt; {
          //service.list() calls ref.getClient() internally
          expect(service.list('/share')).toEqual(Observable.of(mockFileList));
  
          expect(ref.getClient.calls.count()).toBe(1);
  
  
      });
  }); 
  </code></pre>