To mock a service's method and provide a custom return value during testing, you can use a Jasmine _____.
- Assertion
- MockService
- SpyOn
- TestBed
You should fill in the blank with SpyOn. Jasmine's SpyOn function allows you to mock methods and functions for testing, including services' methods.
Loading...
Related Quiz
- In Angular, how can you prevent the default form submission behavior of a page reload?
- For better debugging of Protractor tests, you can take advantage of _____ to take a screenshot of the browser's state when a test fails.
- What is the purpose of the onPrepare function in a Protractor configuration file?
- To continue processing in an Observable sequence after an error occurs, you can use the _____ operator to replace the error with a new source.
- To create a dynamic form in Angular, developers often use the ____ class to programmatically add form controls.