test ported to mocha and running in karma