fix close event callback args
start porting tests to mocha