I’ve just created a jsFiddle with a detailed example of testing Ember.js (latest version: here) using Mocha, Sinon, Chai and the sinon-chai and chai-jquery plugins. This shows how to test models, views and controllers, and how to do full integration tests using jQuery and chai-jquery.
Why Mocha and not Jasmine? Basically, Jasmine is slightly easier to get running, but Mocha seems to be much more actively maintained, it has an excellent ecosystem, and the actual test cases look nearly the same in practice. I’ve recently written two Ember.js test suites using each of Jasmine and Mocha, and I think I’m currently learning towards Mocha.
Anyway, this is pretty much everything I know about testing Ember applications right now. I’m very eager for criticism and feedback. Please feel free to tear this code apart and tell me what I could be doing better.
Two earlier threads on this subject:
@ryanflorence, @joefiorini, @joliss: If anybody wants to work on best practices, guides, or testing conventions, I’m very interesting in doing anything I can to help. I’d love for there to be a set of recommendations for testing Ember applications, complete with tool support and an excellent tutorial. I’ve got a small gap in my consulting schedule coming up, and I’m willing to spend it helping people with the Ember.js testing story in any way possible.