Make async testing more convenient and reliable #331

jzaefferer opened this Issue Oct 17, 2012 · 5 comments


None yet
3 participants

jzaefferer commented Oct 17, 2012

Our stop()/start() API isn't the greatest. Yehuda had some ideas for making that more convenient, outlined here:

Worth noting as well: nodeunit passes in a test object to each test, where the test has to call test.done() in the end. Each test gets its own instance, so there's no risk of one async test bleeding into another, like it currently can happen in QUnit. We should look into providing something similar for QUnit.


rwaldron commented Oct 17, 2012


Yes +9001


Krinkle commented Oct 22, 2012

I implemented the pseudo-context pattern earlier this year for this very reason. The "assert" argument passed to the test functions would be an instance of a QUnit.Assert. And all its methods imply QUnit.start when using config.requireExpects and the last expected assertion is made. For cases where no expect is given and/or for clarity in code we would provide a no-arguments assert.start() that just continues like the global QUnit.start does now.


jzaefferer commented Oct 22, 2012

That's a good point. So make that argument a test-specific instance, and fail if stop/start isn't called on that same instance. asyncTest would use the instance's stop method...

Krinkle was assigned Nov 25, 2012


jzaefferer commented Jan 3, 2013

Some more ideas, baed on the assert argument to the test callback:

test(..., function(assert) { var done = assert.async(); ... done(); }
asyncTest(..., function(assert) { assert.done(); })

jzaefferer commented Feb 13, 2014

Replaced by #534

jzaefferer closed this Feb 13, 2014

Krinkle added the discarded label Feb 14, 2014

Krinkle removed this from the v2.0 milestone Feb 14, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment