How to debug nightwatch tests in VS Code

following is working like charm in my case.

Here is the project structure. following is my launch.json.

 {
// Use IntelliSense to learn about possible Node.js debug attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
                   {
                      "type": "node",
                      "request": "launch",
                      "name": "Nightwatch",
                      "program": "${workspaceRoot}/node_modules/nightwatch/bin/runner.js",
                      "stopOnEntry": false,
                      "args": [
                                 "--test",
                                 "tests/functionality_e2e_test.js"
                              ],           
                       "runtimeExecutable": null,
                       "sourceMaps": false
                  },
                  {
                       "type": "node",
                       "request": "attach",
                       "name": "Attach to Process",
                       "port": 5858
                  }
                 ]
}

above code is the bare minimum requirement to debug Nightwatch js project in visual studio code latest version 1.21.1. I am using node.js v6.11.2. so debugging protocol is legacy.

Thank You Stack Overflow.