Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I debug my JavaScript that is being executed by Chutzpah/PhantomJS

Tags:

I am using Chutzpah to execute my JavaScript unit tests.

I reference paths to my source files and below have a series of tests. Text Explorer in Visual Studio lists my tests and I can execute them directly from the IDE, so everything seems to be working correctly.

However I would like to step into the source code that is being executed when my tests are run.

Is this possible?

like image 559
Greg Avatar asked Sep 24 '12 08:09

Greg


People also ask

How do you debug a test in PhantomJS?

Open a new browser tab and return to the debugging portal at http://127.0.0.1:9000. There should now be a second entry in the bulleted list. Click on this entry to open a new debugger that operates in the context of your page inside PhantomJS.


1 Answers

Update: Version 4.1.0 of Chutzpah adds integrated VS debugging.

enter image description here


This is not currently possible using Chutzpah. The best you can do is to install the context menu extension which will add a "Open In Browser" right click option. Then you can use the browser's built in debugging tool to step through the code.

I would love to add an integrated way to plug into the VS debugging system but have not figured out how to do that yet.

like image 187
Matthew Manela Avatar answered Oct 04 '22 19:10

Matthew Manela