Errors from the debut of function calls when testing the ember application

I am testing a relatively large Ember application ( http://wheelmap.org/map ) with QUnit and has problems with canceled calls, for example. Changing the URL to have a permanent link to the map in the application or to perform an AJAX manual request during testing.

I followed the documentation at http://emberjs.com/guides/testing/integration/

Now, when I reset the state of the application by calling App.reset()in the module settings, it resets all the bindings, etc. to variable and dependent controllers.

module('Map', {
  setup: function() {
    App.reset();
  }
});

It seems that it is good to have a clean working environment, but leads to errors when variables are available Ember.setand Ember.get, for example. this.get('controllers.toolbar'):

Cannot call method 'set' of null

, allways , - . , , - .

, . .

?

!

+3
2

, RunLoop:

Ember.run.cancelTimers()

. , API.

:

module('Map', {
  setup: function() {
    // ...
  },
  teardown: function() {
    Ember.run.cancelTimers()
  }
});
+3

debounce .

, if(Ember.testing){...}.

+1

All Articles