title: Jest not working with fs/promises typescript
body: <p>I'm trying to add jest to my typescript project for testing, but when I run jest, it keeps giving me the error</p>
  <pre><code>  ● Test suite failed to run
  
  Cannot find module 'fs/promises' from 'src/path/to/file'
  
      Require stack:
        src/path/to/file
        test/test.ts
  
      &gt; 3 | import fsp from 'fs/promises';
  
        at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:311:11)
        at Object.&lt;anonymous&gt; (src/path/to/file.ts:3:1)
  </code></pre>
  <p>The program itself runs fine, but whenever I try to run jest on it, it runs into this issue. I've tried adding <code>jest.mock('fs');</code>, which didn't help, and adding <code>jest.mock('fs/promises');</code> gives the same error in the test file.</p>
  <p>I've read that certain versions of Node don't support <code>'fs/promises'</code> and instead need <code>require('fs').promises</code>, which I've tried and still doesn't work (I'm on Node version 12).</p>
  <p>How can I configure jest to be able to load <code>'fs/promises'</code>? I've included my <code>jest.config.js</code> file below:</p>
  <pre class="lang-js prettyprint-override"><code>module.exports = {
    preset: 'ts-jest',
    testEnvironment: 'node',
    testPathIgnorePatterns: [
      '/node_modules/',
      '/out/',
    ],
    moduleDirectories: [
      '.',
      'node_modules'
    ],
    moduleFileExtensions: [
      'ts',
      'tsx',
      'js',
      'jsx'
    ]
  }
  </code></pre>