node.js - Is there a way to know that nodeunit has finished all tests? -
i need run code after nodeunit
passed tests. i'm testing firebase
wrappers , firebase
reference blocks exiting nodeunit after test run.
i looking hook or callback run after unit tests passed. can terminate firebase
process in order nodeunit
able exit.
didn't found right way it.
there temporary solution:
//put *last* test clear if needed: exports.last_test = function(test){ //do_clear_all_things_if_needed(); settimeout(process.exit, 500); // exit in 500 milli-seconds test.done(); }
in case, used make sure db connection or network connect killed way. reason works because nodeunit run tests in series.
it's not best, not way, let test exit.
for nodeunit 0.9.0
Comments
Post a Comment