it is necessary.  and not directly because Ember would call initialize normally more than once, but because of standard practice when testing ember.  in each test, you should include in a afterEach/teardown a call to App.reset().  this flushes from Ember any modules/view/controllers/etc that were created during the test and ‘reinitializes’ Ember.


Jeffrey A. Lage                                                                                                                 
86 Hart St | Beverly Farms | MA | 01915 | email: jefflage@me.com | iPhone: 551.689.4867

On Apr 11, 2014, at 11:27 AM, Vojta Jina <notifications@github.com> wrote:

> In docs/plus/08-emberjs.md:
> 
> > @@ -58,6 +58,25 @@ To execute javascript unit and integration tests with ember.js follow the steps
> >  
> >    Note - the `files` section above should include all dependencies, ie- jQuery/handlebars/ember.js along with the js and handlebars files required to deploy and run your production ember.js application
> >  
> > +  Note - when testing ember applications, it is important that karma not being running the tests until the ember application has finished initialization.  you will need to include a small bootstrap file in the `files` section about to enforce this.  Here's an example:
> > +  ```javascript
> > +  __karma__.loaded = function() {};
> > +
> > +  App.setupForTesting();
> > +  App.injectTestHelpers();
> > +
> > +  var karma_started = false;
> > +  App.initializer({
> > +      name: "run tests",
> > +      initialize: function(container, application) {
> > +          if (!karma_started) {
> Can you try to remove the if (!karma_started) ?
> 
> —
> Reply to this email directly or view it on GitHub.
>