Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set Resolver per-module #173

Closed
trentmwillis opened this issue Aug 11, 2016 · 4 comments
Closed

Ability to set Resolver per-module #173

trentmwillis opened this issue Aug 11, 2016 · 4 comments

Comments

@trentmwillis
Copy link
Member

In the current world, it is easy to set a Resolver to be used for an entire test-suite by using the setResolver method. This is fine in the vast majority of use cases, but with the advent of Engines, and particularly in-repo-engines, we need some additional flexibility as shown in this issue.

One approach that I suggest is to allow setting a resolver option that is passed into the test module like so:

import EngineResolver from 'some-engine/resolver';

moduleForComponent('awesome-component', {
  resolver: EngineResolver.create()
});

Then, when constructing the container/registry for that test module, we'll use the passed in Resolver instead of the globally defined one that was set with setResolver.

This provides backwards compatibility while giving enough flexibility that the ember-engines addon could provide an additional wrapped to allow getting a proper resolver by engine-name. I imagine something like:

moduleForComponent('awesome-component', {
  resolver: getEngineResolver('some-engine')
});
@rwjblue
Copy link
Member

rwjblue commented Aug 11, 2016

This seems good to me.

@dgeb
Copy link
Member

dgeb commented Aug 11, 2016

Works for me as well 👍

@Turbo87
Copy link
Member

Turbo87 commented Aug 18, 2016

resolved by #174

@rwjblue
Copy link
Member

rwjblue commented Aug 18, 2016

Thank you @Turbo87

@rwjblue rwjblue closed this as completed Aug 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants