a few qunit ideas from testing jquery with envjs

a few qunit ideas from testing jquery with envjs


I've been working on running the jquery (1.3.2) tests against env.js.
The tests don't completely pass, but that's kind of expected right now.
The biggest issue is that if a test that calls stop() fails to call
start(), the whole suite stops. Of course, qunit has stop(timeout) for
that, but I'd rather not mangle the jquery test suite. Yet I do want
to run the whole suite. So what I locally added was a qunit option for
minimum timeout. It's used if no timeout is given (none ever is in the
1.3.2 suite) or if the given timeout is less than the minimum. It's
pretty straightforward. There is an alternative, which is a default
timeout that is only applied if no timeout is given, allowing an
override of less than default, even 0. Either will work with my use
case. Don't have a strong opinion on one or the other. Could do both.
A nice to have would be a Qunit.* callback on start and stop. Would
make debugging easier ... Right now the envjs test suite wraps the
qunit calls exported to window, but this doesn't completely work
because stop binds start via a closure, not window, so the timeout-
instigated callback doesn't get wrapped.
Finally, I was wondering about a small tweak to the way assertions are
counted. Right now assertions that aren't called aren't counted in the
total, just the overall expect failure. The net result is the number
of total tests bounces around a lot, as does the number of failures. I
was wondering about counting unexec'd assertions (as detected by
expect) as individual assertions and individual failures instead of
just one failure of expect. Small thing ... maybe it's not a good
idea ... but seems kinda nice?
I can prepare patches for any or all ... or none ...