title: How can I check that a jQuery chainable functions was called in unit test
body: <p>How check a jQuery chainable functions was called in a unit test. For exemple the follow code</p>
  
  <pre><code>function myFunction() {
      var elem = $('#id').removeClass('someClass').addClass('anotherClass');
      return elem;
  }
  </code></pre>
  
  <p>How test if removeClass and addClass are called and have the right values. I'm using sinon to stub, but I recive an error.</p>