title: Unable to import a database connection from a file in Jest
body: <p>I have implemented jest in my project and tests are running fine until a database or Redis connection is needed</p>
  <p>In my test file</p>
  <pre><code>// import  { databaseConnections }  from '../routes/api.js';
  </code></pre>
  <p>In my api.ts file</p>
  <pre><code>    export var databaseConnections : any = {};
  
  async function initializeDB() {
      let result = await getDB();
  
      redisConnections = result['redisConnections'];
      databaseConnections = result['databaseConnections'];
  }
  initializeDB();
  
  
  .....
  </code></pre>
  <p>When I am running the test this is the error I am getting</p>
  <pre><code>TypeError: Cannot read property 'Router' of undefined
  
    54 | var express_basic_auth_1 = require(&quot;express-basic-auth&quot;);
    55 | // Express router
   56 | exports.router = express_1[&quot;default&quot;].Router();
  </code></pre>
  <p>What am i missing</p>