title: Debugging Cypress tests in Visual Studio Code
body: <p>I want to use VS Code to edit and debug Cypress tests.  The cypress docs <a href="https://docs.cypress.io/guides/tooling/IDE-integration#Intelligent-Code-Completion" rel="noreferrer">mention VS Code directly</a>, but don't give any clues about how to configure VS Code's <code>launch.json</code> file for debugging either there or on the debugging page.</p>
  <p>I have a <code>launch.json</code> configuration that starts cypress/electron, but VS Code gives this error:</p>
  <blockquote>
  <p>Cannot connect to runtime process… connect ECONNREFUSED 127.0.0.1:5858</p>
  </blockquote>
  <p>Then shuts it down.</p>
  <p>Looking at the <a href="https://github.com/octref/vscode-electron-debug/tree/master/electron-quick-start" rel="noreferrer">sample electron for VS Code project</a> doesn't help, and adding <code>protocol</code> or <code>program</code> attributes didn't work.</p>
  <p>Here is my configuration:</p>
  <pre class="lang-json prettyprint-override"><code>{
      &quot;name&quot;: &quot;Start integration_tests&quot;,
      &quot;type&quot;: &quot;node&quot;,
      &quot;request&quot;: &quot;launch&quot;,
      &quot;stopOnEntry&quot;: false,
      &quot;cwd&quot;: &quot;${workspaceRoot}&quot;,
      &quot;runtimeExecutable&quot;: &quot;${workspaceRoot}/node_modules/.bin/cypress&quot;,
      &quot;runtimeArgs&quot;: [
          &quot;open&quot;
      ],
      &quot;console&quot; : &quot;internalConsole&quot;,
      &quot;port&quot;: 5858,
  }
  </code></pre>