title: Jest Tests Failing on Github Actions
body: <p>I have a Repo that i'm working on right now that uses clean architecture with TDD. When i run the tests locally on my machine everything is ok. but when i'm trying to use with Github Actions to run on every commit and PR i'm getting a lot of errors. I also have husky and lint-staged.</p>
  <p><a href="https://i.stack.imgur.com/Q2eSm.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q2eSm.png" alt="enter image description here" /></a>
  <a href="https://i.stack.imgur.com/W2t4h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W2t4h.png" alt="enter image description here" /></a></p>
  <p>My jest configs:</p>
  <pre class="lang-js prettyprint-override"><code>// jest.config.js
  module.exports = {
    roots: ['&lt;rootDir&gt;/src'],
    collectCoverageFrom: ['&lt;rootDir&gt;/src/**/*.ts', '!&lt;rootDir&gt;/src/main/**'],
    coverageDirectory: 'coverage',
    testEnvironment: 'node',
    transform: {
      '.+\\.ts$': 'ts-jest'
    },
    preset: '@shelf/jest-mongodb',
  }
  
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>// jest-unit.config.js
  const config = require('./jest.config')
  
  config.testMatch = ['**/*.spec.ts']
  module.exports = config
  
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>// jest-integration.config.js
  const config = require('./jest.config')
  
  config.testMatch = ['**/*.test.ts']
  module.exports = config
  
  </code></pre>
  <pre class="lang-js prettyprint-override"><code>// jest-mongodb.config.js
  module.exports = {
    mongodbMemoryServerOptions: {
      instance: {
        dbName: 'jest'
      },
      binary: {
        version: '4.0.3',
        skipMD5: true
      },
      autoStart: false
    }
  }
  
  </code></pre>
  <p>My Github Action</p>
  <pre><code>name: CI
  
  on:
    push:
      branches: [ master ]
    pull_request:
      branches: [ master ]
  
  jobs:
    build:
      runs-on: ubuntu-latest
  
      steps:
        - name: Checkout Repository
          uses: actions/checkout@v2
  
        - name: Setup Node
          uses: actions/setup-node@v2-beta
          with:
            node-version: '12'
            check-latest: true
  
        - name: Install Dependencies
          run: yarn
  
        - name: Test
          run: yarn test:ci --verbose
  </code></pre>
  <p>and my package.json scripts</p>
  <pre><code>    &quot;start&quot;: &quot;node dist/main/server.js&quot;,
      &quot;build&quot;: &quot;rimraf dist &amp;&amp; tsc&quot;,
      &quot;build:watch&quot;: &quot;tsc -w&quot;,
      &quot;debug&quot;: &quot;nodemon -L --watch ./dist --inspect=0.0.0.0:9222 --nolazy ./dist/main/server.js&quot;,
      &quot;dev&quot;: &quot;docker-compose&quot;,
      &quot;up&quot;: &quot;yarn build &amp;&amp; yarn dev up&quot;,
      &quot;down&quot;: &quot;yarn dev down&quot;,
      &quot;lint&quot;: &quot;eslint 'src/**' --quiet&quot;,
      &quot;lint:fix&quot;: &quot;eslint 'src/**' --quiet --fix&quot;,
      &quot;test&quot;: &quot;jest --passWithNoTests --silent --noStackTrace --runInBand&quot;,
      &quot;test:verbose&quot;: &quot;jest --passWithNoTests --runInBand --watch&quot;,
      &quot;test:unit&quot;: &quot;yarn test --watch -c ./jest-unit.config.js&quot;,
      &quot;test:integration&quot;: &quot;yarn test --watch -c ./jest-integration.config.js&quot;,
      &quot;test:staged&quot;: &quot;yarn test --findRelatedTests&quot;,
      &quot;test:ci&quot;: &quot;yarn test --coverage&quot;
  </code></pre>