title: TypeError: Cannot read property 'calls' of undefined
body: <p>I am trying to write a unit test for my store in react application.<br>
  Unit test looks like:</p>
  
  <pre><code>import FRIENDS from '../../constants/friends';
  import FriendsStore from '../friends_store';
  
  jest.dontMock('../../constants/friends');
  jest.dontMock('../friends_store');
  
  describe('FriendsStore', () =&gt; {
  
      let AppDispatcher;
      let callback;
  
      let addFriends = {
          actionType: FRIENDS.ADD_FRIENDS,
          name: 'Many'
      };
  
      let removeFriend = {
          actionType: FRIENDS.REMOVE_FRIENDS,
          id: '3'
      };
  
      beforeEach(function () {
          AppDispatcher = require('../../dispatcher/app_dispatcher');
          callback = AppDispatcher.register.mock.calls[0][0];
      });
  
      it('Should initialize with no friends items', function () {
          var all = FriendsStore.getAll();
          expect(all).toEqual([]);
      });
  
  
  });
  </code></pre>
  
  <p>And when I executed with <code>jest</code> statement, I've got the error message:</p>
  
  <pre><code>Using Jest CLI v0.4.0
   FAIL  scripts/stores/__tests__/friends_store-test.js (0.811s)
  ● FriendsStore › it Should initialize with no friends items
    - TypeError: Cannot read property 'calls' of undefined
          at Spec.&lt;anonymous&gt; (/Volumes/Developer/reactjs/app5/scripts/stores/__tests__/friends_store-test.js:33:41)
          at jasmine.Block.execute (/Volumes/Developer/reactjs/app5/node_modules/jest-cli/vendor/jasmine/jasmine-1.3.0.js:1065:17)
          at jasmine.Queue.next_ (/Volumes/Developer/reactjs/app5/node_modules/jest-cli/vendor/jasmine/jasmine-1.3.0.js:2098:31)
          at null._onTimeout (/Volumes/Developer/reactjs/app5/node_modules/jest-cli/vendor/jasmine/jasmine-1.3.0.js:2088:18)
          at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)
  1 test failed, 0 tests passed (1 total)
  Run time: 1.028s
  </code></pre>
  
  <p>It seems to be, that jest can not find the <code>calls</code> property. What am I doing wrong?</p>