Home

You can debug your Cucumber tests or Chimpy with the node debugger.

###Debug Chimpy

###Debug Your steps (Cucumber)

###Debug your specs (Mocha)

Debug Chimpy

1. Add breakpoints

Use the debugger; statement in your code to create a breakpoint. You can place additional breakpoints later in the debugging session with the node-inspector user interface.

2. Start chimpy in debug mode

Start chimpy with node in debug mode.

node --debug --debug-brk `which chimpy`
# or for node 8.0
node --inspect --inspect-brk `which chimpy`

Wait until you see debugger listening on port 5858 in the console.

3. Start node-inspector

Install node-inspector.

npm install node-inspector -g

Start node-inspector.

node-inspector

There will be two different debug sessions available.

Chimpy: http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858 Cucumber (and your tests): http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5859

First you need to open the Chimpy debug session. If you don’t want to debug Chimpy itself, just press the resume button in the node-inspector user interface.

Wait until you see debugger listening on port 5859 in the console. Now you can open the Cucumber debug session. After you have set your breakpoints, press the resume button and wait until a breakpoint hits.

Happy debugging!

Debug Cucumber (Your Steps)

1. Add breakpoints

Use the debugger; statement in your code to create a breakpoints. You can place additional breakpoints later in the debugging session with the node-inspector user interface.

2. Tell Chimpy to start Cucumber in debug mode

You can use these command line switched to do that:

chimpy --debugCucumber
# or
chimpy --debugCucumber=<port>

To debug mode and break on start:

chimpy --debugBrkCucumber
# or
chimpy --debugBrkCucumber=<port>

You can then connect your favorite debugger and enjoy!

Debug Mocha (Your Specs)

1. Add breakpoints

Use the debugger; statement in your code to create a breakpoints. You can place additional breakpoints later in the debugging session with the node-inspector user interface.

2. Tell Chimpy to start Mocha in debug mode

You can use these command line switched to do that:

chimpy --debugMocha
# or
chimpy --debugMocha=<port>

To use debug mode and break on start use:

chimpy --debugBrkMocha
# or
chimpy --debugBrkMocha=<port>

Want to become a testing Ninja?

Checkout Xolv.io’s new Quality Faster guide where you can learn how to can bake quality in across the full stack using React, Node.JS, Jest, Meteor and more.