I’d like to gather together how you are testing ember apps and turn it into “The Ember Testing Story”. I’m also going to add tests into ember-tools
generators and want to do it in a blessed path. I seek righteousness in all things, brethren and sisters.
Here’s my current setup for my app:
For Unit tests:
-
I build my app into a single file with ember-tools, which uses browserbuild (commonjs).
-
I then use testacular + jasmine and load my full
application.js
into the test suite. -
I make sure to add
require
to window from browserbuild so I can require my objects normally for their tests
I only have one question so far (and I’ve only got about 30 tests, so not very deep into this yet):
(I’ve talked to tom about this already) I don’t know how to or if I should test my controller methods that use this.get('store')
and this.get('target')
and such. I’m 90% convinced to not care, but 10% of me is sad to not be able to fully test a controller in isolation.
For integration tests:
I haven’t done this yet but I have this dream of pulling the router out of my app and sending it routes to visit and then testing things along with sinon.js to stub out the backend.
Thanks!