In Jasmine, which function is used to create spies that can track calls, arguments, and return values?
- createSpy
- spyOn
- trackSpy
- watchSpy
In Jasmine, the spyOn function is used to create spies. Spies are functions that can replace existing functions or be standalone, and they allow you to track function calls, arguments passed to them, and even control their behavior, including returning specific values.
Loading...
Related Quiz
- Which of the following is a benefit of using content projection in Angular?
- What is the primary purpose of Ahead-of-Time (AOT) Compilation in Angular?
- Why is it recommended to use immutable data structures with the OnPush change detection strategy?
- An application form has a section that should only become available if the user selects a specific option in a dropdown menu. Which Angular feature would you use to conditionally display this section?
- If you want to handle an Observable that emits multiple values over time but you're only interested in the latest value when another Observable emits, which operator would you use?