Skip to content

Commit

Permalink
Merge pull request #4260 from workmanw/setup-ember-dev-use-metal-hooks
Browse files Browse the repository at this point in the history
Modified the setup-ember-dev test helper to use `ember-metal/debug`s override hooks
  • Loading branch information
bmac committed Mar 25, 2016
2 parents c776275 + 2105fc3 commit eece6b6
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 eece6b6

Please sign in to comment.