title: How to setup alias for Jest with craco
body: <p>I'm building react app provided by create-react-app.</p>
  <p>I use craco to make configuration simplify and have set up alise for TypeScript and Webpack.</p>
  <p>But when I run test command, the following error is displayed.</p>
  <ul>
  <li>Error Message</li>
  </ul>
  <pre><code> spec/showMessage.test.tsx
    ● Test suite failed to run
  
      Cannot find module '@/components/atom/TextButton' from 'src/pages/index.tsx'
  
      Require stack:
        src/pages/index.tsx
        spec/showMessage.test.tsx
  
        3 | import styled from 'styled-components';
        4 | 
      &gt; 5 | import { TextButton } from '@/components/atom/TextButton';
          | ^
  
  </code></pre>
  <p>This is my craco.config.js</p>
  <ul>
  <li>craco.config.js</li>
  </ul>
  <pre><code>const path = require(&quot;path&quot;);
  
  module.exports = {
    jest: {
      configure: {
        roots: ['&lt;rootDir&gt;/src', '&lt;rootDir&gt;/spec'],
        testMatch: ['&lt;rootDir&gt;/spec/**/*.{spec,test}.{js,jsx,ts,tsx}'],
      },
    },
    webpack: {
      alias: {
        &quot;@&quot;: path.resolve(__dirname, &quot;./src/&quot;),
        &quot;@@&quot;: path.resolve(__dirname, &quot;./&quot;)
      },
      extensions: ['.ts', '.tsx'],
    },
  };
  
  </code></pre>