We have an Ember app (running on top of Django) which currently has no unit tests. We’ve been putting it off because the state of Ember and testing has been in flux, but I feel that it’s now in a pretty good state and we’d like to begin testing. I’ve been scouring the Googlez for examples but I wanted to ask here first.
Does anyone have what they would consider the definitive (for the time being) guide to unit testing Ember applications with Mocha? I found this post but the last comment was from August 2013.
Our current stack is:
DEBUG: Ember : 1.3.0-beta.1+canary.ea261c9f core.libs.js:5507 DEBUG: Ember Data : 1.0.0-beta.2 core.libs.js:5507 DEBUG: Handlebars : 1.0.0 core.libs.js:5507 DEBUG: jQuery : 2.0.3
All of our application code is contained in a single file
application.activity.js. We have a secondary app which performs reporting that we’d like to split out as well,
Mostly what I’m looking for is guidance on how to split out the various parts of our app for testing. We’re already using grunt to concat some assorted 3rd party libs so we could also use that to concat the pieces and parts into the main application file for production.
In addition to this guidance, I’m wondering what’s the best place to start. Models? Controllers? Routes? Views? We also use a few Handlebars helpers that would be cool to test as well.
Thanks in advance.
PS. I neglected to say that we’d ideally like to test this via CLI. We’re already using Mocha for some tests on our CouchDB views, and it would be cool to continue using it. That said, we’re not adverse to also using PhantomJS if necessary.