Skip to content

Commit

Permalink
Instead, create registry with isolated resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Iaconis authored and nickiaconis committed Dec 7, 2015
1 parent f9ae254 commit 4350ead
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions lib/ember-test-helpers/test-module.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,14 @@ export default Klass.extend({
}
},

_setupContainer: function() {
_setupContainer: function(isolated) {
var resolver = getResolver();
var items = buildRegistry(resolver);

var items = buildRegistry(!isolated ? resolver : Object.create(resolver, {
resolve: {
value: function() {}
}
}));

this.container = items.container;
this.registry = items.registry;
Expand All @@ -284,7 +289,7 @@ export default Klass.extend({

_setupIsolatedContainer: function() {
var resolver = getResolver();
this._setupContainer();
this._setupContainer(true);

var thingToRegisterWith = this.registry || this.container;

Expand All @@ -294,12 +299,7 @@ export default Klass.extend({
thingToRegisterWith.register(fullName, resolver.resolve(normalizedFullName));
}

if (this.registry) {
this.registry.fallback.resolver = function() {};
if (hasEmberVersion(2,3)) {
this.registry.fallback.resolver.resolve = function() {};
}
} else {
if (!this.registry) {
this.container.resolver = function() {};
}
},
Expand Down

0 comments on commit 4350ead

Please sign in to comment.