The debug script will facilitate debugging, akin to binding.pry
in Rails, but not quite.
Add debugger
statements that act as breakpoints:
We can then run:
yarn test:debug
Then navigate to chrome://inspect, in your browser, and click on inspect in the target that you've added:
Click on the Resume script execution button (or cmd
+ \
) to jump to each breakpoint (debugger statement):
You can then watch variables or explore via the console:
You might also find it useful to step to the next line:
Be sure to close this window, when you're done, so that the tests can finish running in your terminal.