- Support Coffeescript testing
- Headless - run from command line
- Test can be written in Coffeescript
Test libraries, two main alternatives:
- Jasmine
- Mocha
Jasmine is older - actively maintained by PivotalLabs, de facto JS testing for Rails projects? So I'd expect there are more gems/projects that integrate Jasmine and Rails compared to Mocha (at the moment anyway).
Mocha is newer - better support for asyn process test (not sure if that matters too much for us at the moment).
Some notes: Evergreen author suggests to use mocha:
I find that Mocha has superior support for testing asynchronous processes, which is kind of important when it comes to JS. It also plays nicer with the node and JS eco system. Jasmine is pretty much unusable in node.js. I'd rather use only one framework, regardless of where I work and Mocha works everywhere.
Although apparently it is not difficult to switch from Jasmine to Mocha in the future source
Options
Not maintained anymore
Both support assets pipeline and thus Coffeescript, both support headless test. Looks really similar - I'd give jasminerice a try simply because it has more downloads (as reported by ruby toolbox).
http://www.derekhammer.com/2012/02/18/testing-coffeescript-for-rails-with-jasmine.html
Future maybe?
Angular Problem: ReferenceError: inject is not defined Solution: Need to include angular js mock.
https://github.com/angular/angular.js/wiki/JsFiddle-Examples - most useful - just look at Jasmine examples https://github.com/angular/angular-seed/blob/master/test/unit/controllersSpec.js - uhm ok .. more details please? https://github.com/IgorMinar/angular-phonecat/blob/master/test/unit/servicesSpec.js - seems outdated