FIX: Use modules for `Ember.run.debounce` hack in testing
This commit is contained in:
parent
e5525d03b8
commit
249dff85c7
|
@ -17,7 +17,7 @@ var define, requirejs;
|
|||
"@ember/runloop": {
|
||||
bind: Ember.run.bind,
|
||||
cancel: Ember.run.cancel,
|
||||
debounce: Ember.run.debounce,
|
||||
debounce: Ember.testing ? Ember.run : Ember.run.debounce,
|
||||
later: Ember.run.later,
|
||||
next: Ember.run.next,
|
||||
once: Ember.run.once,
|
||||
|
|
|
@ -73,8 +73,7 @@ if (window.Logster) {
|
|||
window.Logster = { enabled: false };
|
||||
}
|
||||
|
||||
var origDebounce = Ember.run.debounce,
|
||||
pretender = require("helpers/create-pretender", null, null, false),
|
||||
var pretender = require("helpers/create-pretender", null, null, false),
|
||||
fixtures = require("fixtures/site-fixtures", null, null, false).default,
|
||||
flushMap = require("discourse/models/store", null, null, false).flushMap,
|
||||
ScrollingDOMMethods = require("discourse/mixins/scrolling", null, null, false)
|
||||
|
@ -137,15 +136,9 @@ QUnit.testStart(function(ctx) {
|
|||
|
||||
// Unless we ever need to test this, let's leave it off.
|
||||
$.fn.autocomplete = function() {};
|
||||
|
||||
// Don't debounce in test unless we're testing debouncing
|
||||
if (ctx.module.indexOf("debounce") === -1) {
|
||||
Ember.run.debounce = Ember.run;
|
||||
}
|
||||
});
|
||||
|
||||
QUnit.testDone(function() {
|
||||
Ember.run.debounce = origDebounce;
|
||||
window.sandbox.restore();
|
||||
|
||||
// Destroy any modals
|
||||
|
|
Loading…
Reference in New Issue