using a debugger on the exercism ECMAScript trail14 Jul 2017
When I get stuck, I really like to be able to drop into a debugging environment, have a poke around, see what variables are doing, what the state of the world is. I didn’t find it very straightforward, and some Googl’ing came in useful. Eventually I found the incantation to do what I needed, thanks to this GitHub comment
npm install jest-environment-node-debug --save-dev
node --debug-brk --inspect ./node_modules/.bin/jest -i --env jest-environment-node-debug(node 7) or
node --inspect-brk --inspect ./node_modules/.bin/jest -i --env jest-environment-node-debug(node 8)
- Then go to chrome://inspect (node 8) to open up the debugger and press play until you drop into your debugger.
Well, it worked for me anyway ;)