what's the least resistance path to debugging mocha tests?

后端 未结 10 497
夕颜
夕颜 2020-12-12 17:18

Edit Nov 2016: Node now has a built in debugger that you can start with --inspect. This answer explains it: https://stackoverflow.com/a/39901169/30946.

10条回答
  •  旧时难觅i
    2020-12-12 18:03

    None of the existing answers mention the path of least resistance: When you need to debug Mocha tests, you can simply add another assert that checks the value you'd like to debug.

    myVar.should.equal(expected);
    

    I find this is often all I need. And I just remove the extra assert(s) I used for debugging when I'm done.

提交回复
热议问题