-
Notifications
You must be signed in to change notification settings - Fork 1
How to debug a test in Chrome DevTools
Lloyd Brookes edited this page May 17, 2020
·
3 revisions
Assumes test-runner is installed and you are in the project folder.
-
Place a
debugger
statement in your test:tom.test('Example', async () => { debugger })
-
Run
test-runner
using Node.js directly with the--inspect-brk
flag set:$ node --inspect-brk node_modules/.bin/test-runner
-
Open Google Chrome and navigate to chrome://inspect/.
-
In the "Remote Target" section, click "Inspect" on the test-runner target.
-
In DevTools, click "run" to start test-runner. Execution will pause at the
debugger
statement.