jeudi 17 décembre 2015

Couldn't figure out where to put Ember.run to make the test pass

I have this code that failing the async test which I couldn't figure out where to put Ember.run to solve the problem.

I get this error

Assertion Failed: You have turned on testing mode, which disabled the run-loop's autorun. You will need to wrap any code with asynchronous side-effects in a run

This is my code

return new Ember.RSVP.Promise(function (resolve, reject) {
  Ember.$.getJSON(url).then(function (response) {
    var model = //doing some parsing. It's sync
    resolve(model);
  }.bind(this), function (err) {
    this.get('logger').error('API error', {
      caught: err
    });
    reject(err);
  }.bind(this));
}.bind(this));




Aucun commentaire:

Enregistrer un commentaire