4

I am attempting to run existing qUnit test in Visual Studio 2012 using Chutzpah that are currently in a HTML page and I'm not able to get the VS IDE to recognize the tests. When running a straight JS test VS2012 does recognize the test, for instance when I create testSample.js with something like the following the test shows up 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));
});

What I would like to have is for the tests to run in context of an HTML page so I can inject things into the DOM and test against that. Since I already have qUnit tests in an HTML document I would really like to jsut have VS2012 recognize them. Anyone know how to get Chutzpah to recognize these tests?

As a side note from the documentation it appears as though you should be able to right click a JS file or HTML file with qUnit tests and hit 'Run JS tests' but that option does not sow up for me after running the Nuget Chutzpah package as well as installing the Chutzpah Test Adapter. Anyone know why that option may not be showing up (I did restart the IDE). Thanks in advance

likestoski
  • 1,901
  • 4
  • 24
  • 41
  • 3
    Apparently there are two plugins for VS that tie into chutzpah, with both of them installed and after setting the Tools > Options > Chutzpah > Unit Test Explorer > Testing Mode to 'All' now my tests in the HTML page are recognized and run in the IDE! They are the 'Chutzpah Test Adapter' and 'Chutzpah Test Runner' – likestoski Jul 26 '12 at 20:19
  • 1
    Yea, I have been meaning to change the name of the original extension to clear things up. The extension named 'Chutzpah Test Runner' is the original extension that works in both 2010 and 2012 which just adds a context menu options. The 'Chutzpah Test Adapter' is a more recent extension which plugs into VS 2012's Unit Test Explorer. – Matthew Manela Aug 01 '12 at 19:52
  • Thanks for all your work on this I can't tell you how much nicer it is having all my tests in VS – likestoski Aug 05 '12 at 18:03
  • 1
    likestoski - you should post the solution you found as the answer. – Herb Caudill Mar 05 '14 at 21:54

1 Answers1

0

Apparently there are two plugins for VS that tie into chutzpah. They are the 'Chutzpah Test Adapter' and 'Chutzpah Test Runner'.

With both of them installed and after setting the Tools > Options > Chutzpah > Unit Test Explorer > Testing Mode to 'All' now my tests in the HTML page are recognized and run in the IDE!

likestoski
  • 1,901
  • 4
  • 24
  • 41