title: How to unit test following methods in nodejs using prototype?
body: <pre><code>Client.prototype.a = function(x, y, z) {
      var results = [];
      var result1 = this.foo(x, y, z) ;
      results.push(result1);
      var result2 = this.bar(x, y, z) ;
      results.push(result2);
      return results;
  }
  </code></pre>
  
  <p>I need to unit test:</p>
  
  <ol>
  <li><code>foo</code> and <code>bar</code> were called with <code>x, y and z</code>.</li>
  <li>results array was populated with <code>result1</code> and <code>result2</code>.</li>
  </ol>
  
  <p>I am using sinon, but I am new to sinon testing framework.</p>