From fd9dc9ebb271899ed3047fef7d49cb2580c9c1ab Mon Sep 17 00:00:00 2001 From: Wesley Workman Date: Tue, 22 Mar 2016 14:51:08 -0400 Subject: [PATCH] Modified the setup-ember-dev test helper to use `ember-metal/debug`s override hooks. Ember no longer uses `Ember.deprecate` internally, so overriding that has little effect. --- tests/helpers/setup-ember-dev.js | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tests/helpers/setup-ember-dev.js b/tests/helpers/setup-ember-dev.js index f9fd230501e..faf10add6af 100644 --- a/tests/helpers/setup-ember-dev.js +++ b/tests/helpers/setup-ember-dev.js @@ -4,12 +4,26 @@ import EmberTestHelpers from "ember-dev/test-helper/index"; const AVAILABLE_ASSERTIONS = ['expectAssertion', 'expectDeprecation', 'expectNoDeprecation', 'expectWarning', 'expectNoWarning']; +// Maintain backwards compatiblity with older versions of ember. +var emberDebugModule; +if (Ember.__loader && Ember.__loader.registry && Ember.__loader.registry["ember-metal/debug"]) { + emberDebugModule = Ember.__loader.require('ember-metal/debug'); +} + function getDebugFunction(name) { - return Ember[name]; + if (emberDebugModule && emberDebugModule.getDebugFunction) { + return emberDebugModule.getDebugFunction(name); + } else { + return Ember[name]; + } } function setDebugFunction(name, func) { - Ember[name] = func; + if (emberDebugModule && emberDebugModule.setDebugFunction) { + emberDebugModule.setDebugFunction(name, func); + } else { + Ember[name] = func; + } } var originalModule = QUnit.module;