Debug mocha using visual studio code

Add the following configuration in your launch.json

            "name": "Run mocha",
            "type": "node",
            "request": "launch",
            "program": "${workspaceRoot}/node_modules/mocha/bin/mocha",
            "stopOnEntry": false,
            "args": [
            "cwd": "${workspaceRoot}",
            "runtimeExecutable": null,
            "env": {
                "NODE_ENV": "testing"

You should see a message similar to the following:

To start debugging, open the following URL in Chrome:

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *