title: Jest "Could not locate module" if any dependency has "src" in path
body: <p>In my react app, I am importing a module as follows:</p>
  
  <pre><code>import { isValidAddress } from 'orbit-db';
  </code></pre>
  
  <p>Some dependency of <code>isValidAddress</code> requires <code>multicodec/src/base-table</code> (<a href="https://github.com/multiformats/js-cid/blob/master/src/index.js#L6" rel="noreferrer">see this line</a>).</p>
  
  <p>However, jest gives the following error:</p>
  
  <pre><code>Configuration error:
  
  Could not locate module multicodec/src/base-table mapped as:
  /Users/h/Documents/code/orbit-db-time-machine/src/base-table.
  
  Please check your configuration for these entries:
  {
    "moduleNameMapper": {
      "/src\/(.*)$/": "/Users/h/Documents/code/orbit-db-time-machine/src/$1"
    },
    "resolver": null
  }
  </code></pre>
  
  <p>I think that this is happening because the jest dependency rule <code>"/src\/(.*)$/"</code> is re-writing all paths with <code>src</code> in them to <code>&lt;rootDir&gt;/src</code>, even if they come from a npm module.</p>
  
  <p>I tried to fix this by adding the following config to my <code>package.json</code>:</p>
  
  <pre><code>"jest": {
    "moduleNameMapper": {
      "/multicodec\/(.*)$/": "&lt;rootDir&gt;/node_modules/multicodec/$1"
    }
  }
  </code></pre>
  
  <p>However, this did not change the error. The only way I have been able to remove the error is by removing my <code>import</code> statement - however, this is required in my code.</p>
  
  <p>Note: The code works when run from my react app, it only breaks when I run jest.</p>