Skip to content

Commit

Permalink
Modified the setup-ember-dev test helper to use ember-metal/debugs …
Browse files Browse the repository at this point in the history
…override hooks. Ember no longer uses `Ember.deprecate` internally, so overriding that has little effect.
  • Loading branch information
Wesley Workman committed Mar 23, 2016
1 parent e671cd4 commit fd9dc9e
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions tests/helpers/setup-ember-dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit fd9dc9e

Please sign in to comment.