title: Running Jest tests loop forever
body: <p>Today, for some unexplained reason my jest test files started looping, resulting in a flickering terminal.</p>
  
  <p>I am running <code>jest src --watch</code>, src being my source folder.</p>
  
  <p>I followed a number of other discussions but none of them have helped solve my issue.</p>
  
  <p><a href="https://github.com/facebook/jest/issues/4635" rel="nofollow noreferrer">https://github.com/facebook/jest/issues/4635</a>  is talking about a custom processor, but I am using a default setup.</p>
  
  <p>I have tried ignoring folders.</p>
  
  <p>I have ended up removing all my test files, at which point the looping stops.  If I add a test file to <code>__tests__</code> it matches the file but does not run a test.  If I add the test file to my /src folder, it starts looping again, and it doesn't matter if the actual test passes or fails. Even if I add a fake test with a simple </p>
  
  <pre><code>describe('Test Suite', () =&gt; {
    test('two plus two is four', () =&gt; {
      expect(2 + 2).toBe(4)
    })
  })
  </code></pre>
  
  <p>it loops and flickers.</p>
  
  <p>This is my jest setup</p>
  
  <pre><code>  "jest": {
      "verbose": false,
      "watchPathIgnorePatterns": [
        "&lt;rootDir&gt;/dist/",
        "&lt;rootDir&gt;/node_modules/"
      ],
      "globalSetup": "./jest-setup.js",
      "globalTeardown": "./jest-teardown.js",
      "testEnvironment": "./jest-mongo.js"
    },
  </code></pre>
  
  <p>Does anyone know what is causing this to loop? I am not changing any files in any folder to make the --watch think it needs to run again, there are no other apps i.e. dropbox syncing the folder.</p>
  
  <p>I am developing in VSCode, but the same thing happens if I test in a terminal window.</p>
  
  <p>This was running fine just 5 hours ago, what went wrong?</p>