title: How to mock return value in another file?
body: <p>I'm testing an actions file in flux with jest and can't seem to figure out how to mock a return value in it.</p>
  
  <p>When I specify the return value (see code below) for a mocked module in my test file, everything works fine, but when that same function is called in the module I'm testing, it comes up as undefined.</p>
  
  <pre><code>#MissionActions-test.js
  
  jest.dontMock('../MissionActions');
  describe('MissionActions', function() {
      var GameStore = require(root + 'stores/game/GameStore');
      var MissionActions;
  
      beforeEach(function() {
          MissionActions = require('../MissionActions');
      });
  
      it('should...', function() {
          GameStore.getGame.mockReturnValue({test: "test"});
          console.log(GameStore.getGame()); // prints {test : "test"}
          MissionActions.addMissionFromBank();
      });
  });
  </code></pre>
  
  <p>And MissionActions.js which is being tested.</p>
  
  <pre><code># MissionActions.js
  var GameStore = require('../../stores/game/GameStore');
  
  var MissionActions = {
      addMissionFromBank: function(bankMission) {
          var game = GameStore.getGame();
          console.log(game); // prints undefined
      }
  }
  
  module.exports = MissionActions;
  </code></pre>
  
  <p>My interpretation of the API &amp; automatic mocking is that setting mockReturnValue on a mocked module (in this case GameStore) applies throughout the test, not just within the test file.</p>
  
  <p>How would would I go about mocking the GameStore.getGame() method so that it applies within MissionActions.js as well?</p>