Skip to content

How to debug a test in Chrome DevTools

Lloyd Brookes edited this page May 17, 2020 · 3 revisions

Assumes test-runner is installed.

  1. Place a debugger statement in your test:

    tom.test('Example', async () => {
      debugger
    })
  2. Run test-runner using Node.js directly with the --inspect-brk flag set:

    $ node --inspect-brk node_modules/.bin/test-runner
    
  3. Open Google Chrome and navigate to chrome://inspect/.

  4. In the "Remote Target" section, click "Inspect" on the test-runner target.