title: Jest changed test directory resulting beforeAll is not defined
body: <p>I used to put all my tests together inside of <code>__test__</code> directory. But I decided to put each test files into each component's directory with different name convention.</p>
  <p>Old Structure:</p>
  <pre><code>src/
   __test__/
    example.test.js
    example2.test.js
  </code></pre>
  <p>New Structure:</p>
  <pre><code>src/
   components/
    example/
     example-controller.js
     example-model.js
     example-route.js
     example-test.js
  </code></pre>
  <p>As naming and location of a directory changed, I updated all import statement and namings for according files. I was using default feature of Jest but since I changed test file name to <strong>example-test</strong> from <strong>example.test</strong> I also updated package.json</p>
  <pre><code>&quot;jest&quot;: {
            &quot;testRegex&quot;: &quot;./src/components/*/.*.-test.js$&quot;
   },
  </code></pre>
  <p>Problem is when I run the project, npm run it throws</p>
  <blockquote>
  <p>beforeAll((0, _asyncToGenerator3.default)( /<em>#<strong>PURE</strong></em>/_regenerator2.default.mark(function _callee() {</p>
  <p>ReferenceError: beforeAll is not defined</p>
  </blockquote>
  <p>any idea why it is happening?</p>