title: How configure Jest when using react-app-rewired and customize-cra?
body: <p>I am trying set up tests with <code>Jest</code> in a <code>create-react-app</code> that is using the <code>override</code> function from <code>customize-cra</code> and <code>react-app-rewired</code>. I have set up a relative path alias and when I run tests it throwing the error <code>cannot find module</code></p>
  
  <p>here is the code...</p>
  
  <pre><code>// LoginForm.test.js
  
  import React from 'react';
  import { render, fireEvent } from '@testing-library/react';
  import LoginForm from './LoginForm';
  
  
  it('submits', () =&gt; {
    const onSubmit = jest.fn();
    const { getByText } = render(&lt;LoginForm onSubmit={onSubmit} /&gt;);
    fireEvent.click(getByText('Log in'));
    expect(onSubmit).toHaveBeenCalled();
  });
  </code></pre>
  
  <pre><code>
  // config-overrides.js
  
  const {
    override,
    fixBabelImports,
    addLessLoader,
    addBabelPlugin
  } = require("customize-cra");
  
  module.exports = override(
    fixBabelImports("import", [
      {
        libraryName: "antd",
        libraryDirectory: "es"
        // style: true,
      },
      {
        libraryName: "ant-design-pro",
        libraryDirectory: "lib"
        // style: true,
      }
    ]),
  
    addBabelPlugin([
      "babel-plugin-root-import",
      {
        rootPathSuffix: "./src"
      }
    ]),
  
    addLessLoader({
      javascriptEnabled: true,
      modifyVars: {
        "@select-item-selected-font-weight": "500",
        "@font-family":
          '"Futura W01", "Futura", -apple -system, BlinkMacSystemFont, "Segoe UI", sans-serif',
        "@pagination-font-family":
          '"Futura W01", "Futura", -apple -system, BlinkMacSystemFont, "Segoe UI", sans-serif',
        "@statistic-font-family":
          '"Futura W01", "Futura", -apple -system, BlinkMacSystemFont, "Segoe UI", sans-serif'
      }
    })
  );
  </code></pre>
  
  <p>Any pointers much appreciated, thank you. </p>