Contents tagged with Spy
The first scenario is much easier to implement, while the second one required usage of apply function.
Take a look at the following picture:
There are many js libraries which support both options ( with and without original function ). For example jasmine, … more