We had discussed some potential solutions in Testing Ember Apps: how do you do it?. But mostly everyone is using different solutions and hacking things together to get them to work. I think if we can come up with a recommended set of steps, we can get a lot more force behind a great testing solution (and start publishing that recommendation).
Here are some observations so far:
- There seems to be some consensus that integration tests make more sense than unit testing (except for complicated methods/models).
- It looks like QUnit is the framework of choice.
The biggest question I have so far is: is it better to test full stack (async) vs using a framework like sinon.js to mock AJAX calls? (I’ve done some tests with Sinon and it is really fast.)
@joefiorini started doing a pull request for a guide on how to test apps. And I’d like to help if I can, but want to get the community / core’s input on what they see as best practices around setting up tests.
What other best practices have you figured out as you’ve tested an app? And what should be the “recommended way”?