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

后端 未结 10 482
夕颜
夕颜 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条回答
  •  独厮守ぢ
    2020-12-12 17:40

    In Webstorm now you can just set up using a mocha configuration. Worked pretty much out of the box for me:

    Node interpreter: /usr/local/bin/node
    Working directory: /Users/me/sites/mysite
    Mocha Package: /Users/me/sites/mysite/node_modules/mocha
    

    and then

    All in directory
    Test directory: /Users/me/sites/mysite/test
    

    It also shows you the parameters it runs with so you can probably copy them to another environment if you need to.

提交回复
热议问题