The current implementation of the qunit2 adaptor wraps up the QUnit.test method to cache away the assert object so that it can call it's "async" method. This needs to be generalized to allow such operations in all test context scopes, particularly in the before/beforeEach/after/afterEach module hooks; for example:
The current implementation of the qunit2 adaptor wraps up the QUnit.test method to cache away the assert object so that it can call it's "async" method. This needs to be generalized to allow such operations in all test context scopes, particularly in the before/beforeEach/after/afterEach module hooks; for example:
Will throw the following: TypeError: Cannot read property 'async' of undefined
I've tried out the following workaround in the qunit2 adapter (getting the current assert on-demand without caching), and it seems to work well:
One gotcha that I'm not sure about is if we need a simple "done" variable, or if that should be a stack to push/pop.