implemented mocha unit tests