title: How can I mock nested function with Jasmine& Angular
body: <pre><code>constructor(private searchService: SearchService, private storageService: StorageService) { 
  this.searchService.pagesOutput.subscribe(images =&gt; {
    this.images = images;
    this.pages = this.searchService.numberOfPages;
    
  })
  </code></pre>
  <p>}</p>
  <p>I have a service as a dependency injection. I  would like to mock it for test.
  I know how to mock service and some methods</p>
  <pre><code> searchServiceMock = jasmine.createSpyObj('SearchService', ['pagesOutput']);
   searchServiceMock.pagesOutput.and.returnValue(someValue)
  </code></pre>
  <p>But how can I reach nested functions?(searchServiceMock.pagesOutput.subscribe?)</p>