Jasmine's spyOn: Intercepting Methods Without Breaking Your Code Under Test
Jasmine's spyOn replaces one method on one object, records its calls, and restores the original after each spec. Here's how to pick the right strategy and avoid the common traps.