Rewrite tests with mocha