Chutzpah 4.1 – Visual Studio Debugger Support

A week ago Chutzpah 4.1 which finally adds the ability to debug your unit tests directly from Visual Studio.

 

Changes

 

Debugging from Visual Studio

Thanks to the awesome PR of Martin Connell you can now debug your JS tests from inside of the IDE. You can set breakpoints in your JS files and launch using the Visual Studio Debugger by clicking:

Debug Tests when using the Chutzpah Test Adapter Plugin

or

Run Chutzpah With -> Debugger when using the Chutzpah Context Menu Extension

Chutzpah will then launch Internet Explorer and attach the Visual Studio Debugger to it.

 

NOTE: Before this will work you must ensure script debugging is enabled in IE by going Tools->Internet Options->Advanced and unchecking both Disable script debugging settings.

 
  • Aardvark99

    Question about the new ExpandReferenceComments setting: We use the command line chutzpah to run tests during a build. We generate a chutzpah.json file that looks like this:

    {“Tests”:[{“Path”:”path\path\pathfile.tests.js”}, {Path: …}, {Path: …}, …]}

    We pass this file as the /path parameter on the chutzpah command line. Is there any reason to set ExpandReferenceComments in a file like this? It seems that file is only used to load test files. If there’s a chutzpah.json file in the same folder as the test file themselves it appears that controls the ExpandReferenceComments behavior – is that correct?

    • The only reason to use ExpandReferenceComments is if you want Chutzpah to read the contents of that file and scan for ///<reference comments and use those to find more files. If you are already using the chutzpah.json file I recommend you solely use that for defining your references.

      • Aardvark99

        We do require it read and scan for the ///. I want to keep it doing this! Changing over to a full json file implementation with tests and references isn’t something we could do without setting some time aside. We have like 1000 unit tests across many files and 4 projects that whose tests cannot be run together (plus lots of developers across 2 sites that would have understand this change). We may change this in the future, but for now I just want to keep things working as is. (we have a demo at an event soon, so no big changes until we deliver) ANYWAY….

        I’m pretty familiar with your tool as I’ve been through the source a few times including looking at the diffs that added this new flag. What I see is that as long as my chutzpah.json file doesn’t include a “Tests” section the tool will still fall back to scanning. This is basically the situation we have – and this is fine for now. However, we do create a single chutzpah.json file that does include a “Tests” section. This is ONLY used to kickoff a testing run via the command line version of chutzpah (via the /path argument).

        See the code at TestRunner.js line 456 (// If the path list contains only chutzpah.json files then use those files for getting the list of test paths).

        My question is for THOSE type of chutzpah.json files! This file is not located anywhere near our actual test files and is NOT the json file the actual running of the tests load later.

        I want to know if I should (even though the current code doesn’t care) still add the ExpandReferenceComments property to the Tests>Path JSON object when sending test files to the command line app via a json file. Will it maybe matter in the future?

        EDIT: also it seems disqus doesn’t like unclosed angle brackets!! (that’s why your comment above looks all crazy!!)

      • Correct, add the ExpandReferenceComments to your test path settings in that case. It won’t hurt :)