title: NodeJS - Running tests with Jest: getting an error with TypeScript config file
body: <p>I'm trying to run some tests with Jest but I keep getting an error. It's something to do with a TypeScript config file, I already searched but didn't find much. I'm using NodeJS, TypeORM with TypeScript.</p>
  <p>I'm getting this error when running  <code>yarn test</code>:</p>
  <blockquote>
  <p>Error: Jest: Failed to parse the TypeScript config file</p>
  <p>C:\Users\demis\Documents\Projects\Personal\nlw_node\jest.config.ts
  TypeError: registerer.enabled is not a function***
  at readConfigFileAndSetRootDir (C:\Users\demis\Documents\Projects\Personal\nlw_node\node_modules\jest-config\build\readConfigFileAndSetRootDir.js:150:13)
  at readConfig (C:\Users\demis\Documents\Projects\Personal\nlw_node\node_modules\jest-config\build\index.js:217:18)
  at readConfigs (C:\Users\demis\Documents\Projects\Personal\nlw_node\node_modules\jest-config\build\index.js:406:26)
  at runCLI (C:\Users\demis\Documents\Projects\Personal\nlw_node\node_modules@jest\core\build\cli\index.js:230:59)
  at Object.run (C:\Users\demis\Documents\Projects\Personal\nlw_node\node_modules\jest-cli\build\cli\index.js:163:37)</p>
  </blockquote>
  <p><code>First.test.ts</code>:</p>
  <pre><code>describe(&quot;First&quot;, () =&gt; {
    it(&quot;should&quot;, () =&gt; {
      expect(2 + 2).toBe(4);
    });
  });
  </code></pre>
  <p><code>jest.config.ts</code>:</p>
  <pre><code>export default {
    bail: true,
    clearMocks: true,
    coverageProvider: &quot;v8&quot;,
    preset: &quot;ts-jest&quot;,
    testEnvironment: &quot;node&quot;,
    testMatch: [&quot;**/tests/*.test.ts&quot;]
  };
  </code></pre>
  <p><code>tsconfig.json</code>:</p>
  <pre><code>{
     &quot;compilerOptions&quot;: {
        &quot;lib&quot;: [
           &quot;es5&quot;,
           &quot;es6&quot;
        ],
        &quot;target&quot;: &quot;es5&quot;,
        &quot;module&quot;: &quot;commonjs&quot;,
        &quot;moduleResolution&quot;: &quot;node&quot;,
        &quot;outDir&quot;: &quot;./build&quot;,
        &quot;emitDecoratorMetadata&quot;: true,
        &quot;experimentalDecorators&quot;: true,
        &quot;sourceMap&quot;: true
     }
  }
  </code></pre>
  <p><code>package.json</code>:</p>
  <pre><code>{
    &quot;name&quot;: &quot;nlw_node&quot;,
    &quot;version&quot;: &quot;0.0.1&quot;,
    &quot;description&quot;: &quot;Awesome project developed with TypeORM.&quot;,
    &quot;devDependencies&quot;: {
      &quot;@types/express&quot;: &quot;^4.17.11&quot;,
      &quot;@types/jest&quot;: &quot;^26.0.20&quot;,
      &quot;@types/node&quot;: &quot;^8.0.29&quot;,
      &quot;@types/uuid&quot;: &quot;^8.3.0&quot;,
      &quot;jest&quot;: &quot;^26.6.3&quot;,
      &quot;nodemon&quot;: &quot;^2.0.7&quot;,
      &quot;ts-jest&quot;: &quot;^26.5.3&quot;,
      &quot;ts-node&quot;: &quot;3.3.0&quot;,
      &quot;typescript&quot;: &quot;^4.2.3&quot;
    },
    &quot;dependencies&quot;: {
      &quot;body-parser&quot;: &quot;^1.18.1&quot;,
      &quot;express&quot;: &quot;^4.15.4&quot;,
      &quot;mysql&quot;: &quot;^2.14.1&quot;,
      &quot;reflect-metadata&quot;: &quot;^0.1.10&quot;,
      &quot;typeorm&quot;: &quot;0.2.31&quot;,
      &quot;uuid&quot;: &quot;^8.3.2&quot;
    },
    &quot;scripts&quot;: {
      &quot;start&quot;: &quot;nodemon src/index.ts&quot;,
      &quot;typeorm&quot;: &quot;ts-node node_modules/typeorm/cli.js&quot;,
      &quot;test&quot;: &quot;jest&quot;
    }
  }
  
  </code></pre>
  <p><code>ormconfig.ts</code>:</p>
  <pre><code>{
    &quot;type&quot;: &quot;mysql&quot;,
    &quot;host&quot;: &quot;localhost&quot;,
    &quot;port&quot;: 3306,
    &quot;username&quot;: &quot;root&quot;,
    &quot;password&quot;: &quot;root&quot;,
    &quot;database&quot;: &quot;nlw_node&quot;,
    &quot;synchronize&quot;: true,
    &quot;logging&quot;: false,
    &quot;entities&quot;: [&quot;src/api/models/**.ts&quot;],
    &quot;migrations&quot;: [&quot;src/database/migrations/**.ts&quot;],
   
    &quot;cli&quot;: {
      &quot;entitiesDir&quot;: &quot;src/entity&quot;,
      &quot;migrationsDir&quot;: &quot;./src/database/migrations&quot;,
      &quot;subscribersDir&quot;: &quot;src/subscriber&quot;
    }
  }
  </code></pre>