Re:Django, now with JavaScript tests
by pluma on Thursday July 02, 2015 @08:54PM
(#9822739)
Jasmine is widespread but Mocha is pretty much the norm for modules on NPM. This is in part because Mocha is considerably easier to instrument.
[ Parent
| on HN ]
Indeed, it's better in a bunch of ways! The one that finally got me to switch was that Jasmine didn't have an official CLI version for the longest time; it was browser-based and the CLIs were all third-party (and none of them very good). It includes one now, but it was too late.
We first adopted Jasmine for our internal JavaScript tests in ArangoDB (https://www.arangodb.com) to replace the ancient and inconvenient framework we were using before. It worked, kinda, but it was a mess. We still needed something to expose to developers wishing to test their own apps in the DB and doing that with Jasmine proved to be pretty much impossible.
It was extremely straightforward to integrate with Mocha, though. We just needed to stub out some of the node.js-specific code and provide a very small wrapper to provide our own module loader and reporting plugins. There is an active effort to split up Mocha into multiple modules in order to make it more portable, which would make the stubbing unnecessary, too.