title: React Testing library custom setup import test-utils: module not installed. Unable to resolve path
body: <p>I'm trying to configure jest absolute path for my custom test-utils directory (<a href="https://testing-library.com/docs/react-testing-library/setup#configuring-jest-with-test-utils" rel="nofollow noreferrer">https://testing-library.com/docs/react-testing-library/setup#configuring-jest-with-test-utils</a>), but I get the error Cannot find module 'test-utils' / unable to resolve path</p>
  <p>My folder tree</p>
  <pre><code>-src/
  --utils/
  ---test-utils/
  ----test-utils.js
  ----custom-queries.js
  -jest.config.js
  -jsconfig.json
  </code></pre>
  <p>My jest.config.js</p>
  <pre><code>module.exports = {
      transform: {
          '^.+\\.jsx?$': 'babel-jest',
      },
      testEnvironment: 'jsdom',
      moduleNameMapper: {
          '\\.(css|less)$': 'identity-obj-proxy',
      },
      moduleDirectories: [
          'node_modules',
          'src',
          'utils',
          'test-utils',
      ],
  };
  </code></pre>
  <p>My jsconfig.json</p>
  <pre><code>{
    &quot;compilerOptions&quot;: {
      &quot;baseUrl&quot;: &quot;src&quot;,
      &quot;paths&quot;: {
        &quot;test-utils&quot;: [&quot;./utils/test-utils&quot;]
      }
    },
    &quot;include&quot;: [&quot;src&quot;],
    &quot;exclude&quot;: [&quot;node_modules&quot;]
  }
  </code></pre>
  <p>My component test</p>
  <pre><code>import { render } from 'test-utils';
  import React from 'react';
  import '@testing-library/jest-dom/extend-expect';
  
  import Alert from './alert';
  
  describe('Alert', () =&gt; {
      test('Renders Alert component', () =&gt; {
          const { getByRole } = render(&lt;Alert message=&quot;Success!&quot; /&gt;);
          const alert = getByRole(/alert/);
          expect(alert).toHaveTextContent('Success!');
      });
  });
  </code></pre>