Debugging jasmine-node tests with node-inspector

前端 未结 3 1403
时光说笑
时光说笑 2020-12-13 06:55

Does anyone have any idea if this is possible? Most of the sample for node-inspector seemed geared toward debugging an invoked webpage. I\'d like to be able to debug jasmine

3条回答
  •  孤街浪徒
    2020-12-13 07:00

    My uneducated guess is that you'd need to patch jasmine, I believe it spawns a new node process or something when running tests, and these new processes would need to be debug-enabled.

    I had a similar desire and managed to get expressso working using Eclipse as a debugger: http://groups.google.com/group/nodejs/browse_thread/thread/af35b025eb801f43

    …but I realised: if I needed to step through my code to understand it, I probably need to refactor the code (probably to be more testable), or break my tests up into smaller units.

    Your tests is your debugger.

提交回复
热议问题