Rewrote tests from jasmine to mocha/chai