Check out a free preview of the full Unit Testing JavaScript (with CoffeeScript) course:
The "SpyOn Function" Lesson is part of the full, Unit Testing JavaScript (with CoffeeScript) course featured in this preview video. Here's what you'd learn in this lesson:

As mentioned earlier, Jasmine Spies are able to sub any function and track calls to it and any arguments passed. The spyOn method is used to create a spy. Dave and Justin talk about how spies can be used to monitor the instantiation of template files in client-side applications.

Get Unlimited Access Now