title: How to test files that use browserify-shim global's in Jest?
body: <p>I'm downloading the google maps API v3 via a script tag, and I'm adding the dependency to my modules with the following (relevant) <em>package.json</em> configuration:</p>
  
  <pre><code>"browserify-shim": {
     "google": "global:google"
  }
  </code></pre>
  
  <p>And I can add the dependency in my files with the following:</p>
  
  <pre><code>var google = require('google');
  </code></pre>
  
  <p>When I run my code in the browser, it works fine.
  The problem is, when I run my tests with Jest, it tells me that it can't find the 'google' module:</p>
  
  <pre><code>Error: /src/app/assets/javascripts/__tests__/helpers-test.js: Cannot find module 'google' from '/src/app/assets/javascripts/__tests__'
  </code></pre>
  
  <p><strong>Note:</strong> </p>
  
  <p>This dependency is being required in the file that I'm testing, not the test itself. I find this confusing since I thought that Jest mocks all dependencies unless it is specified otherwise, but from what I can see, it first needs to correctly satisfy the dependencies before mocking.</p>
  
  <p>Any ideas of what am I missing or what approach should I take?</p>