Mocha breakpoints using Visual Studio Code

后端 未结 20 1342
星月不相逢
星月不相逢 2020-12-12 11:52

Is it possible to add breakpoints to ones Mocha tests using Visual Studio Code?

Normally when debugging code one need to configure the launch.json, setting the prog

20条回答
  •  无人及你
    2020-12-12 12:11

    1. Go to Debug > Add Configuration... menu
    2. Select Node.js environment
    3. Select Mocha Tests option from the appeared drop-down list
    4. Type the path of your test file as the last item of the args property
    5. Add a breakpoint
    6. Click on Debug icon
    7. Select Mocha Tests as a configuration
    8. Press Start debugging button
    9. :-)

提交回复
热议问题