title: How to spy on the original function and not the dummy in Jasmine for javascript testing?
body: <p>I looked at the other questions regarding spying on functions in Jasmine but I didn't get my doubt answered there. I intend to use <code>andCallThrough</code> to track my original function in my <code>src</code> script. This is what I have: </p>
  
  <pre><code>describe("My Test to spy :", function() {                                       
      var mySpy = jasmine.createSpy(window, "login");                             
      beforeEach(function(){
          mySpy();
      });
  
      it("Expects login() will be called", function(){                               
        expect(mySpy).toHaveBeenCalled();                                         
      });    
  });
  </code></pre>
  
  <p>So this test passes because its the spy that is being called right? Not the original implementation of the function. So if I use <code>mySpy.andCallThrough()</code> it gives an error. The docs are all about chaining objects and for methods. Nothing for functions. Need some help.</p>