title: Jasmine-node - Creating a spy on a constructor called inside other function
body: <p>I'm novice in jasmine and I need to write some unit tests for node.js app in this framework.
  I have some problems, one of them is this described below:</p>
  
  <pre><code>var sampleFunction = function(){
      var loader = new Loader(params);
      // rest of logic here
  }
  </code></pre>
  
  <p>I want to write unit test for <code>sampleFunction</code>. To do this I need to create spy on <code>Loader</code> constructor and check what this constructor gets as params and what kind of object is it returning.</p>
  
  <p>Any ideas how to do that? I tried to create spy on <code>Loader.prototype.constructor</code> but it wasn't a solution to this problem.</p>