QUnit Love
QUnit Love
We've started using QUnit pretty heavily at work and love it. We've
made some changes/improvements to make it more XUnit-ish (most of which
are based on a single, breaking change).
The changes are listed below. I'd like to know if the jQuery community
has any interest in these and if I should submit a patch or should I
"fork"-off with them and make a separate jQuery plugin for 'em or
something? Please advise.
Below are the changes. Thanks in advance!
Sincerely,
Chad Myers
These include:
1.) Fixed some bugs in stats reporting
a. 0 of 0 tests failed when where were really 17 tests
b. Test timing would sometimes give really wacky results
2.) Adding better stats output
a. included # successful tests
b. added some hidden divs with well-known ID's for easier integration
with WatiR/WatiN and Continuous Integration)
3.) Added a beforeEach/afterEach option so you can have test
setup/teardown capabilities.
Unfortunately, the status stuff required the tests to be wrapped in a
function so I could tell when all the tests were REALLY done.
Code that looked like this:
$(document).ready(function(){
test(..., function(){
};
});
Now looks like this:
qUnitTestSuite(function(){
test(..., function(){
};
});
It isn't real painful to switch, but it *IS* breaking.