0

Using Chutzpah with Visual Studio 2012. I have an HTML test harness with tests inline. But Chutzpah doesn't seem to "scan" these files so that they appear in Test Explorer.

Here's the body of my HTML. I am including the qunit.js files. But the test "Can I find a div named myDiv?" never appears in Test Explorer. Do I need to put the HTML files in a certain folder in order to be detected?

In Tools->Options->Chutzpah, I have the Testing Mode set to "All"

<div id="myDiv"></div>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
<script>
    test("Can I find a div named myDiv?", function () {
        var myDivLength = $('#myDiv').length;
        equal(myDivLength, 1, "expected 1, got " + myDivLength);
    });
</script>

Has anyone experienced a simliar issue? I feel like Chutzpah is putting my Javascript in its own test harness HTML file rather than using mine. But with version 2.1, the documentation states it should use those files: http://matthewmanela.com/

brentlightsey
  • 2,026
  • 1
  • 19
  • 23
  • For now, I've resolved the issue by dynamically adding markup to the qunit-fixture class. Then they will run in test explorer. – brentlightsey Oct 04 '12 at 15:04
  • I looked into this issue and it is related to a race condition between Chutzpah and the QUnit running in your html file. I have a fix but it is not ideal. In the next version of Chutzpah (which I should release in a week) you just need to tell QUnit not to autorun (window.QUnit.config.autostart = false;) and that should resolve the problem. – Matthew Manela Oct 13 '12 at 22:59

0 Answers0