{"__v":11,"_id":"55b6b6276127b12500364560","category":{"__v":1,"_id":"56cf5c8d336aa60b0086a40d","pages":["56cf5ea2287eb20b009f9f2e"],"project":"559b65bd8b04e90d00702d54","version":"559b65bd8b04e90d00702d57","sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-02-25T19:57:01.905Z","from_sync":false,"order":2,"slug":"advanced","title":"Advanced"},"parentDoc":null,"project":"559b65bd8b04e90d00702d54","user":"55a4738a68c7e20d0036d4de","version":{"__v":6,"_id":"559b65bd8b04e90d00702d57","project":"559b65bd8b04e90d00702d54","createdAt":"2015-07-07T05:38:05.890Z","releaseDate":"2015-07-07T05:38:05.890Z","categories":["559b65be8b04e90d00702d58","55a46e7468c7e20d0036d4d1","55a4971be6c2470d002a6483","55a4a690e10ba50d00b40bba","55a4bcf31a5f991700a94066","56cf5c8d336aa60b0086a40d"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"1.0.0","version":"1.0"},"updates":["572bddd580b61a0e006afe54"],"next":{"pages":[],"description":""},"createdAt":"2015-07-27T22:52:23.715Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":1,"body":"You can debug your Cucumber tests or Chimp with the node debugger.\n\n###[Debug Chimp](#debug-chimp)\n\n###[Debug Your steps (Cucumber)](#debug-cucumber-your-steps)\n\n###[Debug your specs (Mocha)](#debug-mocha-your-specs)\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Debug Chimp\"\n}\n[/block]\n\n## 1. Add breakpoints\n\nUse 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.\n\n\n## 2. Start chimp in debug mode\n\nStart chimp with node in debug mode.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"node --debug --debug-brk `which chimp`\",\n      \"language\": \"shell\",\n      \"name\": \"\"\n    }\n  ]\n}\n[/block]\nWait until you see `debugger listening on port 5858` in the console.\n\n## 3. Stat node-inspector\n\nInstall node-inspector.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"npm install node-inspector -g\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nStart node-inspector.\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"node-inspector\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nThere will be two different debug sessions available.\n\n**Chimp:** [http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858](http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858)\n**Cucumber** (and your tests): [http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5859](http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5859)\n\nFirst you need to open the [Chimp debug session](http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858). If you don't want to debug Chimp itself, just press the resume button in the node-inspector user interface.\n\nWait until you see `debugger listening on port 5859` in the console. Now you can open the [Cucumber debug session](http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5859). After you have set your breakpoints, press the resume button and wait until a breakpoint hits.\n\nHappy debugging!\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Debug Cucumber (Your Steps)\"\n}\n[/block]\n## 1. Add breakpoints\n\nUse 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.\n\n\n## 2. Tell Chimp to start Cucumber in debug mode\n\nYou can use these command line switched to do that:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"chimp --debugCucumber\\n# or\\nchimp --debugCucumber=<port>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nTo debug mode and break on start:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"chimp --debugBrkCucumber\\n# or\\nchimp --debugBrkCucumber=<port>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nYou can then connect your favorite debugger and enjoy!\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Debug Mocha (Your Specs)\"\n}\n[/block]\n# 1. Add breakpoints\n\nUse 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.\n\n\n## 2. Tell Chimp to start Mocha in debug mode\n\nYou can use these command line switched to do that:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"chimp --debugMocha\\n# or\\nchimp --debugMocha=<port>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]\nTo use debug mode and break on start use:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"chimp --debugBrkMocha\\n# or\\nchimp --debugBrkMocha=<port>\",\n      \"language\": \"shell\"\n    }\n  ]\n}\n[/block]","excerpt":"","slug":"debugging","type":"basic","title":"Debugging"}
You can debug your Cucumber tests or Chimp with the node debugger. ###[Debug Chimp](#debug-chimp) ###[Debug Your steps (Cucumber)](#debug-cucumber-your-steps) ###[Debug your specs (Mocha)](#debug-mocha-your-specs) [block:api-header] { "type": "basic", "title": "Debug Chimp" } [/block] ## 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. Start chimp in debug mode Start chimp with node in debug mode. [block:code] { "codes": [ { "code": "node --debug --debug-brk `which chimp`", "language": "shell", "name": "" } ] } [/block] Wait until you see `debugger listening on port 5858` in the console. ## 3. Stat node-inspector Install node-inspector. [block:code] { "codes": [ { "code": "npm install node-inspector -g", "language": "shell" } ] } [/block] Start node-inspector. [block:code] { "codes": [ { "code": "node-inspector", "language": "shell" } ] } [/block] There will be two different debug sessions available. **Chimp:** [http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858](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](http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5859) First you need to open the [Chimp debug session](http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5858). If you don't want to debug Chimp 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](http://127.0.0.1:8080/?ws=127.0.0.1:8080&port=5859). After you have set your breakpoints, press the resume button and wait until a breakpoint hits. Happy debugging! [block:api-header] { "type": "basic", "title": "Debug Cucumber (Your Steps)" } [/block] ## 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 Chimp to start Cucumber in debug mode You can use these command line switched to do that: [block:code] { "codes": [ { "code": "chimp --debugCucumber\n# or\nchimp --debugCucumber=<port>", "language": "shell" } ] } [/block] To debug mode and break on start: [block:code] { "codes": [ { "code": "chimp --debugBrkCucumber\n# or\nchimp --debugBrkCucumber=<port>", "language": "shell" } ] } [/block] You can then connect your favorite debugger and enjoy! [block:api-header] { "type": "basic", "title": "Debug Mocha (Your Specs)" } [/block] # 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 Chimp to start Mocha in debug mode You can use these command line switched to do that: [block:code] { "codes": [ { "code": "chimp --debugMocha\n# or\nchimp --debugMocha=<port>", "language": "shell" } ] } [/block] To use debug mode and break on start use: [block:code] { "codes": [ { "code": "chimp --debugBrkMocha\n# or\nchimp --debugBrkMocha=<port>", "language": "shell" } ] } [/block]