Using mocha to write unit test