title: How to debug Jest Tests when using Yarn 2 / Yarn PnP
body: <p>I'd like to use the <code>node --debug-brk</code> feature described in <a href="https://stackoverflow.com/q/33247602/5129731">a previous answer</a> and the <a href="https://jestjs.io/docs/en/troubleshooting#tests-are-failing-and-you-dont-know-why" rel="nofollow noreferrer">jest docs</a> to debug in npm/yarn 1 based projects, but <code>node_modules/</code> is <a href="https://classic.yarnpkg.com/en/docs/pnp/" rel="nofollow noreferrer">not present</a> in Yarn 2 / PnP (Plug n Play) based projects, so those instructions won't work for me.</p>
  
  <p>The usual way to <a href="https://yarnpkg.com/cli/run#examples" rel="nofollow noreferrer">access a binary in yarn 2</a> of <code>yarn run --inspect-brk jest --runInBand</code> launches a debugging session from the terminal, but when connecting to Chrome's Remote Target inspector  via <code>chrome://inspect</code>, we get an error message about being unable to connect to the jest.js binary, since it's a path to a <code>.zip</code> file.</p>
  
  <pre class="lang-sh prettyprint-override"><code>Uncaught Error: Cannot find module '/Users/MY_USERNAME/PATH_TO_MY_PROJECT/.yarn/cache/jest-npm-24.9.0-8ddb425e99-2.zip/node_modules/jest/bin/jest.js
  </code></pre>
  
  <p>What workarounds are available without downgrading to Yarn 1?</p>