Repository navigation
Ensure that setup callback is invoked with the correct context. - #12
Conversation
There was a problem hiding this comment.
We want to delete setup from this.callbacks before contextualizeCallbacks is called. Otherwise, setup will get added to cache['setup'].
Perhaps we need another array, something like postSetupSteps, that will be invoked with the proper this.context. And then we should allow invokeSteps to take a context argument, which will be either this or this.context.
I can do this as a separate PR if you like or we can chat on IRC.
There was a problem hiding this comment.
Maybe to be clear we should introduce both contextualizedSetupSteps and contextualizedTeardownSteps, both of which will be invoked with the module's context.
There was a problem hiding this comment.
Sounds good, I'll update in a few....
b487fcc to
463c20d
Compare
|
@dgeb - Updated per conversation in IRC and comments here. |
Previously, the `setup` callback was invoked via `invokeSteps` (and therefore was bound to the `TestModule` instance itself). Now it is invoked with the same context as the tests themselves. * Ensure `setup` callback is invoked with the test context. * Ensure `teardown` callback is invoked with the test-module context. * Removed `beforeTeardown`. * Added `afterTeardown` which is invoked with the test-module context. * Simplify callback ordering tests.
463c20d to
b489976
Compare
Ensure that `setup` callback is invoked with the correct context.
|
Many thanks @rwjblue - this is a big improvement! |
|
Tagged as 0.3.0. |
Previously, the
setupcallback was invoked viainvokeSteps(andtherefore was bound to the
TestModuleinstance itself). Now it isinvoked with the same context as the tests themselves.
setupcallback is invoked with the test context.teardowncallback is invoked with the test context.beforeTeardown.afterTeardownwhich is invoked with the test-module context./cc @dgeb