title: Constants not available for jest tests in Actions
body: <p>When I run navAction-test.js below I get following error: TypeError: Cannot read property 'DATA_LOADED' of undefined</p>
  
  <p>As I understand it the constant.DATA_LOADED is undefined, I'm guessing jest is mocking it and for this reason constant is undefined, I've tried everything I could find on the next but it remains undefined. </p>
  
  <p>Is there anyone out there who can help. I would really appreciate it. </p>
  
  <p>navAction.js:</p>
  
  <pre><code>var dispatcher = require('../dispatcher/AppDispatcher');
  var constants = require('../constants/constants');
  
  module.exports = {
  
      load: function() {
      def = $.ajax({
          url: 'http://api.facebook.com/',
          data: {},
          success: function (data, textStatus, jqXHR) {
              dispatcher.dispatch({type: constants.DATA_LOADED, data: data});
          }
      });
      }
  }
  </code></pre>
  
  <p>navAction-test.js:</p>
  
  <pre><code>jest.dontMock('../navAction.js');
  
  describe('Tests NavigationCollectionActionCreators', function() {
  
      var $;
      var dispatcher;
      var navAction;
  
      beforeEach(function() {
      $ = require('jquery');
      dispatcher = require('../../dispatcher/AppDispatcher');
      navAction  = require('../navAction.js');
      });
  
      it('tests calls $.ajax &amp; dispatcher ', function () {
      navAction.load();
      $.ajax.mock.calls[0][0].success({body: {header: {items: [{name: 'The name', link: 'http://www.facebook.com'}]}}});
  
      expect(dispatcher.dispatch).toBeCalledWith({type: 'DATA_LOADED', data: [{name: 'The name', link: 'http://www.timeout.com'}]});
      });
  
  });
  
  //constants.js
  var keyMirror = require('keymirror');
  
  module.exports = keyMirror({
      DATA_LOADED: null,
  });
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>I got this to work by adding the following to navAction-test.js:</p>
  
  <pre><code>var constants = {
      DATA_LOADED: 'DATA_LOADED',
      DATA_NOT_LOADED: 'DATA_NOT_LOADED'
  };
  jest.setMock('../../constants/constants', constants);
  </code></pre>
  
  <p>Is this the correct way of doing it?</p>