Last active
          February 2, 2019 11:45 
        
      - 
      
- 
        Save chsami/cb191e95a5eca422e431ebee8a8768e8 to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | // delegate to your own implementation | |
| spyOn(MoviesComponent, 'getMovies').and.callFake(() => {}); | |
| //delegate to your own implementation with an argument | |
| spyOn(MoviesComponent, 'getMovies').withArgs('').and.callFake(() => {}); | |
| //return a specific value 'false' | |
| spyon(MoviesComponent, 'getMovies').and.returnValue({movies: ['terminator', 'titanic', 'avatar']}}); | |
| //delegate to the actual implementation | |
| spyOn(MoviesComponent, 'getMovies').and.callThrough(); | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment