This is a rough guide on how to use Chrome to debug intern tests. If you know of a better way, please update.
- add
debugger;
to set a breakpoint in your source code - 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.
- 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
- Open Chrome and paste
chrome://inspect/#devices
in the address bar. - Under the section titled
Remote Target
you should seewith the last wordnode_modules/intern/client.js file:///Users/joe/ion-js/node_modules/intern/client.js inspect
inspect
being a link. Click on it and the debugger pops-up in a new window
- The
inspect
link gets refreshed every time you runnode
with--inspect-brk
- Source files are not always refreshed by chrome. You might have to clear your Chrome browsers cache