5

I'm running tests using Spectron, mocha and chai-as-promised. My IDE is Visual Studio Code.

I start the app from within the tests as follows:

this.app = new Application({
        path: electron,
        args: ['.']
    });
// Then at some point I run this.app.start()

Can I connect the Visual Studio Code debugger to this application? I can run debug my test code but I need to debug the app at some point.

Mark Micallef
  • 1,041
  • 2
  • 10
  • 25
  • Also trying to see how this can be done, would love to have full debug capabilities to both the test and app, let me know if you have any updates Mark. – Harvey Lin Dec 21 '17 at 01:04

1 Answers1

0

Yes you can debug your tests with VsCode.

For enable to debug, you should add specific configurations to launch.json like below to .

  {
  "name": "Debug Test Process",
  "type": "node",
  "request": "launch",
  "cwd": "${workspaceRoot}",
  "program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
  "args": [
    "--timeout",
    "999999",
    "--colors",
  ]
}
slckayhn
  • 1,083
  • 11
  • 20