Using Chutzpah with VS2012 to run JS tests on an HTML page

I am trying to run an existing qUnit test in Visual Studio 2012 using Chutzpah, which are currently located on an HTML page, and I cannot force the VS IDE to recognize the tests. When performing a direct test, JS VS2012 recognizes the test, for example, when I create testSample.js with something like the following: the test appears in the VS IDE.

test("Adding Two Numbers Succeeds", function () { expect(1); var num1 = 10; var num2 = 25; var exp = num1 + num2; equal(exp, addNumbers(num1, 25)); }); 

I would like the tests to run in the context of an HTML page so that I can inject things into the DOM and validate them. Since I already have qUnit tests in an HTML document, I would really like VS2012 to recognize them. Does anyone know how to get Chutzpah to recognize these tests?

As a note to the documentation, it looks like you can right-click on a JS file or HTML file using qUnit tests and click on β€œRun JS tests”, but this option does not seed me after running Nuget Chutzpah, as well as installing the Chutzpah test adapter. Does anyone know why this option might not display (I restarted the IDE). thanks in advance

+4
source share
1 answer

There are apparently two plugins for VS that are related to chutzpah. These are the Chutzpah Test Adapter and the Chutzpah Runner Run.

If both of them are installed even after installation in Tools> Options> Slightly> w100> Explorer> Testing for Everything, now my tests on the HTML page are recognized and run in the IDE!

0
source

All Articles