constructor(private searchService: SearchService, private storageService: StorageService) {
this.searchService.pagesOutput.subscribe(images => {
this.images = images;
this.pages = this.searchService.numberOfPages;
})
}
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
searchServiceMock = jasmine.createSpyObj('SearchService', ['pagesOutput']);
searchServiceMock.pagesOutput.and.returnValue(someValue)
But how can I reach nested functions?(searchServiceMock.pagesOutput.subscribe?)