mocha tests working both in browser and command line