title: Typescript + jasmine.createSpy()
body: <p>I'm writing unit tests for my angular project with Typescript</p>
  
  <p>When I try to create mock for some service, I use this way:</p>
  
  <pre><code>const serviceMock = &lt;IMyService&gt;{
      method: _.noop,
  };
  
  beforeEach(inject($injector =&gt; {
     testingService = new AccountingService(serviceMock);
  
     spyOn(serviceMock, 'method').and.callFake(()=&gt;'hello');
   }
  </code></pre>
  
  <p>this works ok
  but when I try to use <code>jasmine.createSpy()</code>, I get compilation errors:</p>
  
  <pre><code>const serviceMock = &lt;IMyService&gt;{
      method: jasmine.createSpy('method').and.callFake(()=&gt;'hello'),
  };
  
  Type '{ method: Spy;}' cannot be converted to type 'MyService'. Property 'getParams' is missing in type '{ method: Spy;}'.
  </code></pre>
  
  <p>But <code>getParams</code> is private method of <code>MyService</code></p>
  
  <p>What am I doing wrong?</p>