What's the right way to enable the node debugger with mocha's --debug-brk switch?

后端 未结 5 613
北恋
北恋 2020-12-12 14:04

I have some debugger statements in my module under test and want to run mocha with --debug-brk set and hit my breakpoint so that I can inspect the state of my module. Unfort

5条回答
  •  情深已故
    2020-12-12 14:19

    run mocha with flag --inspect-brk and click 'open dedicated DevTools for node' in chrome from page chrome://inspect. In dedicated DevTools window add connection localhost:9229 to connect automatically.

    Also add a debugger statement to the file you want debug.

    (this is using latest versions of node and chrome as of October 2017)

提交回复
热议问题