title: Jasmine testing - Error upon spy definition
body: <p>I have the following classes</p>
  <pre class="lang-js prettyprint-override"><code>export class Init {
     constructor(url: URL) {}
     
     getClient(url: URL): Client {
      return new Client(url);
    }
  }
  </code></pre>
  <p>and the client is defined like</p>
  <pre class="lang-js prettyprint-override"><code>export class Client {
     constructor(readonly url: URL) {}
  
     foo(s: String): Promise&lt;void&gt; {}
  
     // many other methods
  }
  </code></pre>
  <p>and now I am trying to test this like so - with Jasmine</p>
  <pre class="lang-js prettyprint-override"><code>it('foo should be invoked', done =&gt; {
     const init = new Init('test-url');
     
     spyOn(init.getClient,'foo');
  
     ...
  }
  </code></pre>
  <p>On the spy definition I get this error</p>
  <pre><code>Argument of type 'string' is not assignable to parameter of type 'never'
  </code></pre>
  <p>Why can I resolve this? <code>Init</code>'s <code>getClient</code> method returns a <code>Client</code> object. Shouldn't the spy be able to identify this type?</p>
  <p>My end result should look like this</p>
  <pre class="lang-js prettyprint-override"><code>it('foo should be invoked', done =&gt; {
     const init = new Init('test-url');
     
     spyOn(init.getClient,'foo');
  
     expect(initCommand.getClient.foo).toHaveBeenCalledTimes(1);
  }
  </code></pre>