Browse Source

don't clock in testrunner

doing so jams integration tests:
https://github.com/emberjs/ember.js/issues/3008#issuecomment-71607940
Rafał Pitoń 10 years ago
parent
commit
ee18f0771d
1 changed files with 6 additions and 3 deletions
  1. 6 3
      misago/emberapp/app/services/clock.js

+ 6 - 3
misago/emberapp/app/services/clock.js

@@ -6,9 +6,12 @@ export default Ember.Object.extend({
 
   doTick: function () {
     var self = this;
-    Ember.run.later(function () {
-      self.set('_tick', !self.get('_tick'));
-    }, ENV.APP.TICK_FREQUENCY);
+    if (ENV.environment !== 'test') {
+      // running this loop in tests will block promises resolution
+      Ember.run.later(function () {
+        self.set('_tick', !self.get('_tick'));
+      }, ENV.APP.TICK_FREQUENCY);
+    }
   }.observes('_tick').on('init'),
 
   _tick: false