title: JestJs thinks ajax is not called
body: <p>I'm having a lot of trouble getting a simple jest test to work. Jest insists that my Ajax call is not happening, with the error message:</p>
  
  <pre><code>FAIL  authTest.js (1.828s)
  ● Authentication: Logging In › it Doesn't currently have a logged in user
    - Expected Function to be called with { url : 'api/loggedin', type : 'GET', error :       &lt;jasmine.any(function Function() { [native code] })&gt;, success : &lt;jasmine.any(function Function() { [native code] })&gt; }.
      at Spec.&lt;anonymous&gt; (/Users/ritmatter/reps/spec/authTest.js:13:20)
      at Timer.listOnTimeout [as ontimeout] (timers.js:110:15)
  </code></pre>
  
  <p>The code being tested is in a file called auth.jsx, and it looks like this:</p>
  
  <pre><code>loggedIn: function() {
    return $.ajax({
      url: 'api/loggedin',
      type: 'GET',
      error: function(xhr, status, err) {
        return false;
      }.bind(this),
      success: function(data) {
        return true;
      }.bind(this),
    });
  },
  </code></pre>
  
  <p>The test looks like this:</p>
  
  <pre><code>/** @jsx React.DOM */
  "use strict";
  var React = require('react/addons');
  var TestUtils = React.addons.TestUtils;
  
  describe('Authentication: Logging In', function() {
    it('Doesn\'t currently have a logged in user', function () {
      var $ = require('jquery');
      jest.dontMock('../js/auth.jsx');
      var auth = require('../js/auth.jsx');
      auth.loggedIn();
      expect($.ajax).toBeCalledWith({
        url: 'api/loggedin',
        type: 'GET',
        error: jasmine.any(Function),
        success: jasmine.any(Function)
      });
    });
  });
  </code></pre>
  
  <p>Any idea why jest would think that this is not getting called? I've been looking around, and it seems like there are some bugs with respect to dontMock() and mock().</p>