When testing an Angular service, why might you use a spy?

  • To create a new instance of the service
  • To mock dependencies used by the service
  • To secretly record user interactions
  • To simulate service method calls
In Angular testing, you use a spy to mock dependencies used by the service being tested, allowing you to control and observe interactions with those dependencies.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *