title: Jest Puppeteer tests fail when running together (synchronously)
body: <p>Technology Used:</p>
  <ul>
  <li>npm</li>
  <li>jest</li>
  <li>jest-puppeteer</li>
  </ul>
  <p>If I run my tests one by one they individually pass</p>
  <pre><code>$ npm test test/file.to.test.js
  
  ...
  
  Test Suites: 1 passed, 1 total
  Tests:       6 passed, 6 total
  </code></pre>
  <p>However if I run my tests as a group then then errors are rampant</p>
  <pre><code>$ npm test
  
  ...
  
  Test Suites: 6 failed, 6 total
  Tests:       88 failed, 17 todo, 4 passed, 109 total
  </code></pre>
  <p><strong>Question</strong></p>
  <p>My situation seems to be related to some kind of jest/puppeteer caching or chrome session sharing. Regargless, how can I debug this further?</p>
  <p><strong>Extra</strong></p>
  <p>While writing this question I found that using the argument <code>--runInBand</code> (from <a href="https://stackoverflow.com/questions/49937456/randomly-failing-tests-jest-and-supertest-node-js">this answer</a>) makes it so all tests pass but they are run sequentially which makes the tests take substantially longer - normally jest tests run in parallel.</p>
  <p><strong>Settings</strong></p>
  <p><em>package.json</em></p>
  <pre><code>&quot;test&quot;: &quot;set NODE_ENV=test &amp;&amp; jest --runInBand --detectOpenHandles --forceExit&quot;,
  </code></pre>
  <p><em>jest-puppeteer.config.js</em></p>
  <pre><code>module.exports = {
      launch: {
          devtools: true, // allows for use of 'debugger;' in tests
          // executablePath: '/usr/bin/chromium-browser',
          headless: true,
          defaultViewport: {
              width: 1024,
              height: 768,
              //isMobile: true,
              //hasTouch: true,
          },
          ignoreDefaultArgs: ['--disable-extensions'],
          args: [
              '--enable-font-antialiasing',
              '--font-render-hinting=medium',
              '--disable-gpu',
              '--disable-dev-shm-usage',
              '--disable-setuid-sandbox',
              '--no-first-run',
              '--no-sandbox',
              '--no-zygote',
              '--single-process',
  
              &quot;--renderer&quot;,
              &quot;--no-service-autorun&quot;,
              &quot;--no-experiments&quot;,
              &quot;--no-default-browser-check&quot;,
              &quot;--disable-extensions&quot;,
          ]
      },
      // server: {
      //     command: &quot;npm run serve&quot;,
      //     port: 9000,
      //     launchTimeout: 180000
      // },
      browser: 'chromium',
      browserContext: 'default'
  };
  </code></pre>