title: Jasmine wait till function called by listener gets executed
body: <p>So I have this function which is called when some backbone model attribute is set. I.e:</p>
  
  <pre><code>this.listenTo(model, "change:someattr", changeCallback);
  </code></pre>
  
  <p>What I want to do in my Jasmine tests is to set this attribute and then check if <code>changeCallback</code> got called successfully and if it resulted in desired changes. In my code below it looks like my <code>changeCallback</code> function gets called after jasmine assertions are executed.</p>
  
  <pre><code>that.model.set('someattr', 'xyz');
  expect(that.model.changeCallback).toHaveBeenCalled();
  </code></pre>
  
  <p>Any ideas how to test this? All code examples I've found deal with asych calls which are executed directly on asynchronous function.</p>