qUnit test page result and aggregration?
Posted: Fri Jan 22, 2010 7:51 am
I'm getting into qunit for javascript testing. One thing I notice right away is these guys don't seem to believe in defect localization. The test *methods* usually will have like 20+ assertions (each assertion should be it's own test IMO).
So essentially their test *methods* are really actually test *suites* or fixtures in disguise.
But I would consider the fixture to be the HTML at the bottom of the qUnit page. If you look at it this way then your entire test harness uses the same monolithic fixture. you can see this is how the jquery test suite was done.
Efforts have been made by jsUnit and they have an impressive demo showing a plethora of pages being loaded and tested which is very sexy. But that also has its short comings
So essentially their test *methods* are really actually test *suites* or fixtures in disguise.
But I would consider the fixture to be the HTML at the bottom of the qUnit page. If you look at it this way then your entire test harness uses the same monolithic fixture. you can see this is how the jquery test suite was done.
Efforts have been made by jsUnit and they have an impressive demo showing a plethora of pages being loaded and tested which is very sexy. But that also has its short comings
Plus qunit is so much less verbose. So basically I'd like to keep using it, but it is not clear how I should organize my tests.Under most platform/browser combinations, Test Functions are "auto-discovered" - that is, JsUnit can scan the Test Page and discover what Test Functions are present. For Mac 0S9 with IE5, Mac OSX with IE5, KDE with Netscape 6.x/Mozilla 0.9 and KDE with Konqueror, however, auto-discovery is not supported. You must expose the Test Function names using the exposeTestFunctionNames() function. This function must return a string array of all the Test Functions in the page.