Moved to mocha
Fix undefined handling