1
Vote

Correct Settings for chutzpah.json

description

I've updated VS2013 to U2 as it RTM'ed today. Now, both my projects compile the TS code with no errors, but when I run my tests, Chutzpah fails to find 3 tests. The error I get is the same error I was seeing when I was working with TS 0.9.5. That is, some code I was writing in my project did not work with TS 0.9.5, but it did in the Playground from the TS web site (which I'm assuming was using 1.0) and today this code now compiles correctly. But Chutzpah seems to be compiling that code with an older version of TS, so I get the errors.

Then after digging I found out about chutzpah.json and Compile settings. So I tried to add this:

{
"Framework": "qunit",
"Compile" :  {
    "Mode" :  "External"
}
}

That caused all sorts of havoc, here's an example of one of the errors:

Error: Error: pushFailure() assertion outside test context, was at file:///C:/USERS/JASON/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/12.0/EXTENSIONS/VZHSP524.J41/TestFiles/QUnit/qunit.js:946
at file:///C:/USERS/JASON/APPDATA/LOCAL/MICROSOFT/VISUALSTUDIO/12.0/EXTENSIONS/VZHSP524.J41/TestFiles/QUnit/qunit.js:452
at startQUnit (phantomjs://webpage.evaluate():12)
at onPageLoaded (phantomjs://webpage.evaluate():16)
at phantomjs://webpage.evaluate():18
at phantomjs://webpage.evaluate():18
So, I'm confused as to what I'm supposed to set in chutzpah.json to tell it to not compile my code (VS will do that with my project automatically) and just evaluate the .js files for tests. What am I doing wrong with the json settings file? TIA.

comments

jasonrbock wrote May 12 at 7:10 PM

Well, I changed chutzpah.json to this:

{
"Framework": "qunit",
"RootReferencePathMode": "SettingsFileDirectory",
"References":  [ { "Path": "../" } ],
"Compile":  {
    "Mode":  "External"
}
}

And now the discovery engine finds all the tests, but I seem to get duplicates of the tests in the test explorer. Not sure what that is... :S

mmanela wrote May 13 at 2:30 PM

Can you upload a zip repro of your issue? I think you probably just aren't configuring things correctly but its hard for me to tell without a repro.