Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 1.32 KB

DEBUGGER.md

File metadata and controls

30 lines (20 loc) · 1.32 KB

Debugging Intern Tests

This is a rough guide on how to use Chrome to debug intern tests. If you know of a better way, please update.

Configure Chrome

  1. Enable maps in Chrome

Debugging an Intern Test

  1. add debugger; to set a breakpoint in your source code
  2. build your source code using grunt build:amd:debug
    • build:amd:debug generates map files for .ts source code that other build targets do not.
  3. run the test suite using node --inspect-brk node_modules/intern/client.js config=tests/intern-debug
    • note that we are using a different intern config file that disables code coverage
  4. Open Chrome and paste chrome://inspect/#devices in the address bar.
  5. Under the section titled Remote Target you should see
    node_modules/intern/client.js file:///Users/joe/ion-js/node_modules/intern/client.js
    inspect
    
    with the last word inspect being a link. Click on it and the debugger pops-up in a new window

Caveats

  1. The inspect link gets refreshed every time you run node with --inspect-brk
  2. Source files are not always refreshed by chrome. You might have to clear your Chrome browsers cache