Why Explict Invocation of Callback is Needed in setUp and tearDown?
I got to know nodeunit by reading this article http://caolanmcmahon.com/posts/unit_testing_in_node_js which should been written when nodeunit is at earlier phase. It doesn't mention that explicit invocation of callback function in setUp and tearDown.
There is no documentation about which arguments should be sent by invoking callback in setUp and tearDown. So, I suppose, in most cases, callback is just invoked without any arguments.
Why bother to require explicit invocation of this callback? can't it just be invoked by the system after setUp and tearDown is invoked?
Thanks, -Morgan
I may be wrong, but an explicit callback is required in case setUp or tearDown call any asynchronous code. The call to the callback is the only way the framework can know the setup or tear-down is complete.